Skip to content

Conversation

@joshuat
Copy link
Collaborator

@joshuat joshuat commented Sep 8, 2022

This is useful for creating discriminated unions with the oneOf type.

Because we're forced to use JSON Schema draft 4 we don't have access to the const property, but we do have access to enum, and const is just syntactic sugar for a single-element enum anyway.

Copy link
Collaborator

@avaly avaly left a comment

Choose a reason for hiding this comment

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

This looks great! Again! Thanks a lot for your changes!

Just a small request: can you please add a couple of oneOf and constant properties in the schema.full unit test?

@joshuat
Copy link
Collaborator Author

joshuat commented Sep 8, 2022

@avaly I've added constant to the schema.full unit test, but when adding oneOf an error surfaced so I opened #313 to address that. That PR also adds oneOf to the schema.full unit test.

@joshuat joshuat force-pushed the josh/feat/constant-type branch from 4074671 to 3e4785b Compare September 8, 2022 13:30
@joshuat joshuat force-pushed the josh/feat/constant-type branch from 3e4785b to b2a369b Compare September 8, 2022 13:57
@avaly avaly enabled auto-merge (squash) September 12, 2022 12:28
@avaly avaly disabled auto-merge September 12, 2022 12:29
@avaly avaly merged commit e676703 into plexinc:main Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants