swag icon indicating copy to clipboard operation
swag copied to clipboard

Support `application/json-patch+json` MIME type

Open bcordobaq opened this issue 1 year ago • 1 comments

Hi, I noticed that the application/json-patch+json MIME type is not supported, which is needed for PATCH operations. This type is defined in RFC 6902. The problem is that the accepted MIME types are a fixed list, so if the type is not mapped there, it breaks during swag generation:

ParseComment error in file XXX.go :json-patch+json accept type can't be accepted

To solve this, a possible solution might be adding the type mapping as json-patch into the MIME list.

Other alternatives might be supporting a full Content-Type declaration, with no mapping, considering the user value as the final accept/produce values.

Thanks!

bcordobaq avatar Mar 06 '23 13:03 bcordobaq

I second this, it seems like application/pdf is also not accepted.

icanc0 avatar Aug 25 '23 12:08 icanc0