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

Generate type matching operator for derived types #22

Merged
merged 3 commits into from
Jan 12, 2024
Merged

Conversation

glopesdev
Copy link
Member

@glopesdev glopesdev commented Jan 8, 2024

This PR automatically generates type matching operators for discriminated union types. This will allow easier handling of polymorphic types by simultaneously filtering and casting sequences of base types.

The current implementation generates a single type matching operator for each base type declaring a discriminator property. A type mapping property is provided to select the concrete target type. Available property values are taken from the list of derived types extracted from the input schema.

@glopesdev glopesdev added the proposal Request for a new feature label Jan 8, 2024
@glopesdev glopesdev merged commit 278a0b9 into main Jan 12, 2024
2 checks passed
@glopesdev glopesdev deleted the type-matching branch January 12, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Request for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant