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

Support unions in schema classes #185

Open
dorner opened this issue Apr 20, 2023 · 0 comments
Open

Support unions in schema classes #185

dorner opened this issue Apr 20, 2023 · 0 comments

Comments

@dorner
Copy link
Member

dorner commented Apr 20, 2023

Right now, schema classes only support null as a union type. We don't generate a proper union type out of it. Other code generation tools actually generate a new class representing the union, e.g.

{
  "name": "field-name",
  "type": ["int", "string"]
} 

This should generate an "String" type that allows us to inspect which of the two are given. It should have both int and string attributes so we can retrieve them, and also a more generic value method to retrieve whichever one is set.

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

No branches or pull requests

1 participant