Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema Compositions #2

Closed
lukeed opened this issue Aug 2, 2024 · 1 comment · Fixed by #6
Closed

Schema Compositions #2

lukeed opened this issue Aug 2, 2024 · 1 comment · Fixed by #6

Comments

@lukeed
Copy link
Owner

lukeed commented Aug 2, 2024

  • anyOf
  • oneOf
  • allOf
  • not

https://json-schema.org/understanding-json-schema/reference/combining

@lukeed
Copy link
Owner Author

lukeed commented Aug 6, 2024

The names I'm thinking of now:

Option 1

Use the key names as method names (meh)

t.anyOf()
t.oneOf()
t.allOf()
t.not()

Option 2

Use the actions that the docs use to describe what anyOf, allOf, etc are. (see link above)

t.or() -> anyOf
t.xor() -> oneOf
t.and() -> allOf
t.not() -> not

Option 3

Use custom/mixed naming patterns. AKA, what makes sense to me

t.any() -> anyOf ... but NOT `any` type
t.one() -> oneOf
t.all() -> allOf
t.not() -> not

I lean for Option 2 and Option 3

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant