grongierisc / objectscript-openapi-definition

The objectif of this library is to generate the ObjectScript Class from an OpenApi defintion v2.
MIT License
2 stars 5 forks source link

Handle underscored property #4

Open grongierisc opened 4 years ago

lscalese commented 3 years ago

Hi @grongierisc !

Yes, underscore is problem for generate property name or classname.

There is a similar problem with OpenAPI-client-gen Issue Link I used your librairy in this project.

For fix it, I translated underscore for each "$ref" fields and "Definitions" keys. It avoid an error in your lib.

Also, I should fix parameters name, ex : "parameters":[{"name":"user_name",... I know objectscript support syntax like set obj."user_name"="test". This use case isn't fix right now (I'm not sure about the best way for fix it).

grongierisc commented 3 years ago

In fact, it's not mandatory to fix underscore for property fields but it's for classname.

I'll try to find a best solution for this problem. I let you know.

lscalese commented 3 years ago

Finally, It's not a problem. I needed to add a pre-processing to simplify complex swagger files. If a character is a problem, I can easily translate before calling your generator.