Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Support multiple types in Schema Object #606

Merged
merged 1 commit into from
Feb 23, 2021
Merged

Support multiple types in Schema Object #606

merged 1 commit into from
Feb 23, 2021

Conversation

kylef
Copy link
Member

@kylef kylef commented Feb 23, 2021

This completes full support for multiple types in OpenAPI 3.1 schemas, this builds up on the work from other recent changes:

  • Support null 3.1 type in Schema Object
  • Normalise OpenAPI type as an array internally - this brings some upfront refactoring so the code base deals with array of types. The internal interfaces are updated, with assumption that type can never be more than one.
  • Support array of type in Schema Object - brings array of types to our public interface (i.e, support from input), but restricts the types to only allow 1. That changes brings all the logic for parsing arrays, duplicate detection, and the various test cases for parsing the array.
  • Support null with other types on OpenAPI 3.1 - brings support for specifying a type alongside null (and removes nullable for OpenAPI 3.1 which is replaced by null). Null is more of a special case in terms of types because for most part, in API Elements null alongside another type is that type with a nullable attribute.

@kylef kylef added the openapi3 label Feb 23, 2021
Base automatically changed from kylef/null to master February 23, 2021 11:51
@kylef kylef force-pushed the kylef/multi-types branch from 14e78e8 to 5bc71bc Compare February 23, 2021 11:52
Copy link
Contributor

@opichals opichals left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️ 🚀

@kylef kylef merged commit 2e47835 into master Feb 23, 2021
@kylef kylef deleted the kylef/multi-types branch February 23, 2021 12:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants