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

Basic types? #726

Open
MrTrick opened this issue Apr 24, 2023 · 0 comments
Open

Basic types? #726

MrTrick opened this issue Apr 24, 2023 · 0 comments

Comments

@MrTrick
Copy link

MrTrick commented Apr 24, 2023

Is your feature request related to a problem? Please describe.

I have a large schema with many basic elements, where the element subschema is just eg {type:"string"} or similar.
If every element needs to have a type it causes headaches in Go, because an alias of a string is not a string, and it requires lots of explicit casting.

Describe the solution you'd like
Perhaps there could be a flag like 'primitive_types' that, if a subschema specifies only type, will not create a new alias but just use the builtin language type.

Describe alternatives you've considered
I tried defining "title":"string" but that creates an alias called String, same issue.

I considered using a postprocessor to remove those unnecessary aliases, but preferably it could be handled by the transpiler.

I considered monkey-patching the library, but I'm not sure where and what I'd have to tweak.

Additional context
Go example: https://play.golang.com/p/YOf3DeL3_Ut

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