Releases: mattpolzin/OpenAPIKit
More Consistency
What's Changed
- Add missing OAS version property (#437)
In short, whereas OAS version 3.1.2 was added in a non-breaking way via the Version.v3_1_x(x: 2) enum case, this patch adds the missing static property that allows you to refer to that new version as simply Version.v3_1_2 which is in line with prior versions like v3_1_1.
Full Changelog: 4.3.0...4.3.1
Additional Paths To Success
What's Changed
- Add new OAS 3.2.0 HTTP method support (#432)
Breaking Changes
- The OpenAPIKit30module'sOpenAPI.HttpMethodtype has been renamed toOpenAPI.BuiltinHttpMethodand gained the.querymethod (though this method cannot be represented on the OAS 3.0.x Path Item Object).
- The OpenAPImodule'sOpenAPI.HttpMethodtype has been updated to support non-builtin HTTP methods with the pre-existing HTTP methods moving to theOpenAPI.BuiltinHttpMethodtype andHttpMethodhaving just two cases:.builtin(BuiltinHttpMethod)and.other(String).
Full Changelog: 5.0.0-alpha.3...5.0.0-alpha.4
Forwards Is Backwards (5)
What's Changed
- Add support for mapping newer OAS versions to older ones (#433)
Warning
Although this change is not being considered breaking, it does subtly change the phrasing of decoding errors for the Document Version. This may cause some tests written to expect exact string values for errors to fail.
Details
OpenAPIKit adds support for new OAS versions when it has support for most or
all of the features of that OAS version. If you want to parse an OpenAPI
Document that is written in a newer version than OpenAPIKit supports and you
are asserting that the newer version is possible to parse as if it were the
pre-existing version, you can tell OpenAPIKit to parse the newer version as if
it were the older version.
You do this with userInfo passed into the Decoder you are using. For
example, to decode a hypothetical document version of "3.100.100" as if it
were version "3.1.1", set your decoder up as follows:
let userInfo = [
  DocumentConfiguration.versionMapKey: ["3.100.100": OpenAPI.Document.Version.v3_1_1]
]
let decoder = ... // JSONDecoder() or YAMLDecoder()
decoder.userInfo = userInfo
let openAPIDoc = try decoder.decode(OpenAPI.Document.self, from: ...)Full Changelog: 5.0.0-alpha.2...5.0.0-alpha.3
Forwards Is Backwards
What's Changed
- Add support for mapping newer OAS versions to older ones (#433)
Warning
Although this change is not being considered breaking, it does subtly change the phrasing of decoding errors for the Document Version. This may cause some tests written to expect exact string values for errors to fail.
Details
OpenAPIKit adds support for new OAS versions when it has support for most or
all of the features of that OAS version. If you want to parse an OpenAPI
Document that is written in a newer version than OpenAPIKit supports and you
are asserting that the newer version is possible to parse as if it were the
pre-existing version, you can tell OpenAPIKit to parse the newer version as if
it were the older version.
You do this with userInfo passed into the Decoder you are using. For
example, to decode a hypothetical document version of "3.100.100" as if it
were version "3.1.1", set your decoder up as follows:
let userInfo = [
  DocumentConfiguration.versionMapKey: ["3.100.100": OpenAPI.Document.Version.v3_1_1]
]
let decoder = ... // JSONDecoder() or YAMLDecoder()
decoder.userInfo = userInfo
let openAPIDoc = try decoder.decode(OpenAPI.Document.self, from: ...)Full Changelog: 4.2.0...4.3.0
Forwards Is Backwards (Backport)
What's Changed
Warning
Although this change is not being considered breaking, it does subtly change the phrasing of decoding errors for the Document Version. This may cause some tests written to expect exact string values for errors to fail.
Details
OpenAPIKit adds support for new OAS versions when it has support for most or
all of the features of that OAS version. If you want to parse an OpenAPI
Document that is written in a newer version than OpenAPIKit supports and you
are asserting that the newer version is possible to parse as if it were the
pre-existing version, you can tell OpenAPIKit to parse the newer version as if
it were the older version.
You do this with userInfo passed into the Decoder you are using. For
example, to decode a hypothetical document version of "3.100.100" as if it
were version "3.1.1", set your decoder up as follows:
let userInfo = [
  DocumentConfiguration.versionMapKey: ["3.100.100": OpenAPI.Document.Version.v3_1_1]
]
let decoder = ... // JSONDecoder() or YAMLDecoder()
decoder.userInfo = userInfo
let openAPIDoc = try decoder.decode(OpenAPI.Document.self, from: ...)Full Changelog: 3.8.0...3.9.0
Bit By Bit
Note that OAS 3.2.0 features are not fully supported even though the "3.2.0" version string is accepted as valid as of this release. New OAS 3.2.0 features will be added over the coming pre-releases.
What's Changed
- Add OAS v3.2.0 representation. Add OAS 3.2.0 improvements to the Tag object (#429)
- Support and prefer new official yaml media type (#430)
Breaking
- Document Version enum gains entries for OAS 3.2.x.
- application/x-yamlremains supports on decode but will always be encoded as- application/yamlgoing forward.
Full Changelog: 5.0.0-alpha.1...5.0.0-alpha.2
5.0.0-alpha.1
Move support for OAS v3.1.2 into the Versions enum.
Breaking Changes
Support for OAS 3.1.2 has been moved into the Versions enum making it a bit more ergonomic to refer to but also breaking any switch statements that enumerate the versions.
Full Changelog: 4.2.0...5.0.0-alpha.1
Officially Clarified
Officially Clarified (backport to 3.x)
What's Changed
- Support OAS 3.1.2 by @mattpolzin in #427
⚠️  Heads up
- From a Swift standpoint, adding OAS v3_1_2is a breaking change if you have anyswitchstatements that match on the version enumeration and don't allow for future additions to the enumeration. This is regrettable but it is not practical to release a new major version of OpenAPIKit when the OAS standard introduces clarification patch versions like is the case this time.
Full Changelog: 3.7.1...3.8.0