Repository navigation
Flexibility is Key
Pre-release
Pre-release
What's Changed
- Optional responses within operations (#303)
- Add core context for
nullschemas (#305) - Optional paths within documents (#275)
New Contributors
- @noamalffasy made their first contribution in #275
Noteworthy Differences
Now paths within documents and responses within operations can both be omitted from documents (as they should be by the OpenAPI 3.1 specification). This only applies to the OpenAPIKit module, the OpenAPIKit30 module represents the OpenAPI 3.0 specification where these properties are still required. Instead of making the properties on the respective OpenAPIKit types Optional, the empty collection of either paths or responses is now entirely omitted when encoding and an omitted value of either is decoded as the empty collection.
Breaking Changes
The following only apply to the OpenAPIKit module, not the OpenAPIKit30 module.
- The
.operationsContainResponsesvalidation is now opt-in instead of applied by default when validating. If you still want to ensure documents have responses in all Operation objects, tack the.operationsContainResponsesvalidation onto your validator, e.g.:try document.validate(using: Validator().validating(.operationsContainResponses)). - The
nullcase ofJSONSchema.Valuenow has aCoreContextproperty associated with it. If you pattern match on it, your code may need to change (though you are still allowed to match against just.nulland ignore the associated value if desirable). - The
JSONSchema.nullproperty that used to serve as a convenient way of creating a null-typeJSONSchemais now a function. You can call it as.null()which means most code will just need to gain the()parens.
Full Changelog: 3.0.0-beta.3...3.0.0-beta.4