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

Add Schema.isSubType for compatibility checking between schemas #2661

Open
schickling opened this issue Apr 30, 2024 · 1 comment
Open

Add Schema.isSubType for compatibility checking between schemas #2661

schickling opened this issue Apr 30, 2024 · 1 comment
Labels
enhancement New feature or request Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. schema

Comments

@schickling
Copy link

What is the problem this feature would solve?

When dealing with schema evolution, it can be very useful to have a way to determine whether schema B is a subtype of schema A in order to understand compatibility relationships between the two schemas.

What is the feature you are proposing to solve the problem?

It would be great if there was an additional function in the @effect/schema module along the lines of: Schema.isSubType(schemaA, schemaB): boolean

This might be not possible in all cases of the current Effect Schema system, so for now this probably requires a limitation to exclude support for Schema.transform but still would work well for schemas that can be mapped from/to JSONSchema.

Related:

What alternatives have you considered?

No response

@schickling schickling added the enhancement New feature or request label Apr 30, 2024
@gcanti gcanti added the schema label Apr 30, 2024
@mikearnaldi
Copy link
Member

Schema.transform could be supported assuming annotations, like to generate json-schema

@gcanti gcanti added the Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Needs Proposal This issue needs a plan that clarifies the finer details of how it could be implemented. schema
Projects
None yet
Development

No branches or pull requests

3 participants