-
Notifications
You must be signed in to change notification settings - Fork 29
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
Entity Individual Property Swift Type Override #176
Comments
Hi @LePips, sorry that it took so long to get around to responding here and thanks for opening up the proposal! Before looking deeper into this, is this something that could be similarly achieved by using a custom https://swagger.io/docs/specification/data-models/data-types/#format
dataTypes:
string:
concept-one: EnumRepresentingConceptOne
concept-two: EnumRepresentingConceptTwo Then in the schema: properties:
conceptTwo:
type: string
format: concept-two |
Thank you for your response and idea about using I do see that performing some pre-processing to add or change the While |
I went ahead and used the |
While property schema
datatype
s can be overridden, I need to be able to override a single entity property type.Context
My schema has a few string properties that are represented by a collection of static strings on the backend. They are not specified in the schema as enums due to the complexity/time of refactoring to use those strings as enums.
So, I have my own Swift enums specified manually and would like to use that to fill in gaps of the schema.
Currently the following would be generated:
What should come from generation:
Implementation
Introduce new config option
entities.propertyTypeOverrides
which represents a mapping of scheme properties to Swift types:This option would take precedence over the datatype override and would follow the same rule:
While my example is specifically for a
String -> enum
case, I think this can be helpful in other contexts.The text was updated successfully, but these errors were encountered: