Open aldirrix opened 22 hours ago
@aldirrix Currently working on this!
@aldirrix to be clear, are you expecting the type names to be pascalcase, or anything inside the actual types too?
@mrlubos I would expect all generated types to be pascal case, if by inside you mean like there is a nested structure eg.
imagine the following is openapi spec 😅
type1: {
prop1: bool,
prop2: #/schemas/someOtherType,
prop3: string
}
Then the result would be something like
export const Type1: {
prop1: bool,
prop2: someOtherType,
prop3: string
}
export const SomeOtherType: {
someOtherProp: string
...
}
Does that make sense?
Yep! I was asking about this but sounds like you don't want to transform the keys too
export const Type1: {
Prop1: bool,
Prop2: SomeOtherType,
Prop3: string
}
export const SomeOtherType: {
SomeOtherProp: string
...
}
Description
Our schema has camel case properties that when transformed into types using the default configuration stay with the same casing eg. a
commandMsg
schema results in a type inside our types.gen.ts likeWhich is understandable. Since we wanted to have them with pascal case, we used the
PascalCase
property inside our config file for the types plugin and then we get the result we want.Later we wanted to try the experimental parser to try some of the available features and realised that the casing is back to camel case. I'd consider this not to be the expected behavior.
our config
Reproducible example or configuration
No response
OpenAPI specification (optional)
No response
System information (optional)
No response