Skip to content

Basic types? #726

@MrTrick

Description

@MrTrick

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions