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

Allow Schema types to be written as inline string literals. #295

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rictic
Copy link
Contributor

@rictic rictic commented Nov 12, 2024

Declaring SchemaType as an enum means that users must reference the schema type off the enum, like SchemaType.OBJECT. That's useful, but it's also nice to be able to just write 'object', and with TypeScript that's equally type safe, IDEs are equally helpful with autocomplete, etc!

This is a backwards compatible change that allows users to write it either way.

junyanxu
junyanxu previously approved these changes Nov 14, 2024
Copy link
Collaborator

@junyanxu junyanxu left a comment

Choose a reason for hiding this comment

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

Approved after offline discussion

junyanxu
junyanxu previously approved these changes Nov 14, 2024
Declaring SchemaType as an enum means that users must reference the schema type off the enum, like SchemaType.OBJECT. That's useful, but it's also nice to be able to just write 'object', and with TypeScript that's equally type safe, IDEs are equally helpful with autocomplete, etc!

This is a backwards compatible change that allows users to write it either way.
@rictic
Copy link
Contributor Author

rictic commented Nov 20, 2024

I rebased and regenerated the docs

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