ad-on-is / adonis-autoswagger

Auto-Generate swagger docs for AdonisJS
MIT License
129 stars 41 forks source link

feat: double type interface #109

Open 0xNekr opened 4 months ago

0xNekr commented 4 months ago

Good evening,

I've made a modification to the way double types are handled, in particular with the null.

I have an interface with several string | null or number | null fields.

and the swagger handled example and schema by returning :

field: {},

What's more, the schema didn't handle the nullable.

So I made the changes to default to the first type specified for the example, and to specify nullable correctly if one of the types is null.

I don't know if this is the best way to do it, so I'll wait for your feedback!

ad-on-is commented 4 months ago

I'm planing on implementing the oneOf functionality based on the swagger specs.

If you're motivated, you can help me out. This would be cleaner imho

0xNekr commented 4 months ago

It's bound to be cleaner!

I'll do what I can with the time I have, have you started anything yet?

ad-on-is commented 4 months ago

have you started anything yet?

image

yes, I added a comment 4 months ago 🤣