Closed fairking closed 11 months ago
Tested, everything works fine on my project.
Form-data is relatively special. If it exists, the form-data format should be used first.
@fairking
Form-data is relatively special. If it exists, the form-data format should be used first.
Sorry for the late reply @Manweill . In this case they should exclude json I assume. I have other spec (see the topic's example) where several content types are included, so we might prefer json over other types.
Let me please know what do you think, and if you think it is still the case I can make changes so we can do your way.
But in my opinion it would be better if we can simply grab the content type from the scheme and include it into the produced TS. What do you think?
I have made some changes, so to get the actual content type from the schema instead. What do you think?
I have tested openapi
(v3) successfully but not swagger
schema. I tried this one but it wasn't working.
Anyone can test swagger
(v2) one?
Form-data is relatively special. If it exists, the form-data format should be used first.
Sorry for the late reply @Manweill . In this case they should exclude json I assume. I have other spec (see the topic's example) where several content types are included, so we might prefer json over other types.
Let me please know what do you think, and if you think it is still the case I can make changes so we can do your way.
But in my opinion it would be better if we can simply grab the content type from the scheme and include it into the produced TS. What do you think?
Usually, we use json by default, but when we use formdata, we should give priority to formdata, because it has special purposes, such as uploading files.
Ok, I have made changes. It make sense and it doesn't introduce any breaking behavior.
After introducing other content types I suggest to fall back on json if it exists. For example in some cases we would have multiple contents:
Of course I am not mentioning xml, but as you can see if such schema exists we would prefer json over anything else. Any thoughts guys?