Open eeue56 opened 7 years ago
I think this is a nice-to-have, since _
, while not idiomatic, works. Also there's the issue of avoiding name collisions. Consider:
Banana:
type: object
properties:
banana_id:
type: string
bananaId:
type: string
which would be valid swagger.
I would argue that that example should actually be invalid swagger. If you have to things with the same name, the only difference being camelCase
and camel_case
, then you've duplicated the fields and made the API inconsistent
I agree it's a bad schema, but it's nonetheless a valid spec. Swagger is very unopinionated on how you name your fields. I suppose it's a separate issue though, since sanitization can already cause collisions.
I would think the ideal approach would be to make swagger-elm warn you when your API contains underscores, and provide a flag for auto-converting it to camelCase
That sounds like a good solution
Example input:
right now generates:
It should instead generate: