Skip to content

Flexibility is Key

Pre-release
Pre-release

Choose a tag to compare

@mattpolzin mattpolzin released this 05 Sep 00:32
0cdd48c

What's Changed

  • Optional responses within operations (#303)
  • Add core context for null schemas (#305)
  • Optional paths within documents (#275)

New Contributors

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.

  1. The .operationsContainResponses validation 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 .operationsContainResponses validation onto your validator, e.g.: try document.validate(using: Validator().validating(.operationsContainResponses)).
  2. The null case of JSONSchema.Value now has a CoreContext property associated with it. If you pattern match on it, your code may need to change (though you are still allowed to match against just .null and ignore the associated value if desirable).
  3. The JSONSchema.null property that used to serve as a convenient way of creating a null-type JSONSchema is 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