I need to change default consumes/produces fields of my _swagger.json_ to application/vnd.api+json. Does it exist a way to generate my swagger.json file with this customized value ?
If you know that your whole API is going to use application/vnd.api+json everywhere, you might just replace it afterwards in your build process by using sed or some other tool like that.
For consumes you could change it in tsoa.json by using the specMerging and spec properties, but for produces that's another story :
produces is currently hard-set to application/json but this could easily be made configurable with a new decorator @Produces()
@Izabrr as a followup, did the above workaround help you? Or do you still need a per-method override for content-type?
Hi @dgreene1
The solution suggested by @Esya has been applied to my projects and I still use it => I use a sed to convert all occurrences of application/json to application/vnd.api+json.
It works very well (because I use this application/vnd.api+json content-type for all endpoints) buuuuuut... a new decorator (like @Produces as suggested) would be an even better solution 馃槃
Hi, any update on this issue? @Produces decorator will be great! But in general strange why you added in specMerging consumes, but didn't add produces, because logic is nearly the same.