Repository navigation
Just do your best
Pre-release
Pre-release
Among the other changes listed below, this release swaps out some errors that used to cause decoding to fail for warnings so that more documents can be decoded even if they don't quite follow the specification. The warnings are stored and you can get at them all easily by calling document.validate(strict: false) which returns all warnings that were produced. By default, validate() will be strict and all warnings will become validation failures, so validation still serves to determine whether a document really follows the spec. to the letter.
Big thanks to @kean for both the direct contributions to the code in this release and also the immensely helpful suggestions and bug reports.
Enhancements
- A few parsing errors have been turned into warnings when there is still some way to finish parsing a document despite a problem being found.
- OpenAPI 3.1 support (the
OpenAPIKitmodule) for multiple examples onJSONSchemaas specified by JSON Schema. - You can disable
VendorExtensionsfrom being decoded or encoded (which can be a big boost to performance) by settingVendorExtensionsConfiguration.isEnabled = false. (@kean) - OpenAPIKit retains the order of more decoded objects (including properties in
JSONSchemaobjects). (@kean)
Bug Fixes
- Fix mistaken decoding of
AnyCodablevalues that aren't strings when aJSONSchema'stypeis specified to bestring. (@kean)
- The
OpenAPIKitmodule (but not theOpenAPIKit30module) now exposes only anexamplesproperty onJSONSchemasand their contexts. This is backwards compatible withexamplewhen decoding, but code that referencesexamplewill need to be updated to use the newexamplesarray instead. - The externally available
ContentTypeis changing from anenumto astruct. Equality checks for all of the previous enum's cases will still work against new static constructors but switch statements will no longer be possible. - Code that works with the newly converted
OrderedDictionaryproperties will likely work without modification, but there are some methods supported byDictionarybut notOrderedDictionaryso some code may need to be tweaked. See #233 if you are curious what properties have changed. Response.StatusCodeis changing from anenumto astruct. Code won't necessarily need to change, but switching on it will need to instead switch on itsvalueproperty.JSONSchemais changing from anenumto astruct(as usual, to facilitate storage of warnings). For most code, use will not change, but if you switch over anyJSONSchemas, you should change to switching over the newly exposedvalueproperty ofJSONSchemainstead.