In our OpenAPI schema all our request bodies state the following content type: application/vnd.api+json
, however, in our docs:
- They’re shown as
application/json
- The examples include
application/json
which means any requests made fail due to unsupported media type
Thanks for the feedback, we will think about how to customize the content-type of the request and display it in the documentation.
No problem Evans
I actually don’t think you need to customise the data structure at all for this fix. The only “breaking” issue is that the content-type value is being misprinted in the headers as application/json
instead of the full string application/vnd.api+json
within the request examples. If those values would just write the actual value as written in the schema, this would resolve the issue and enable us to publish our documentation to our customers
Hi, we will add a feature to configure custom content-type for requests, which will be available as soon as next weekend.
Thanks - that’s great to hear!
Evans I believe this issue is somewhat still present, at least on the Shared Docs side. The content-type is correctly shown in the Editor view, but when viewing a Shared Doc, the content-type remains incorrect for the Request Body, yet oddly its correctly written for the Response Body:
The first 2 screenshots show the Shared Docs Request Body which displays the wrong content type.
The third screenshot shows the Shared Docs Response Body, which is correct.
The fourth shows the Editor View’s Request Body, which is correct. It seems this correct value is lost in translation when sharing the docs.
Thank you for your feedback. Please confirm the following two points:
- Whether share docs and the API documentation are in the same branch?
- Whether to send the correct media type when debugging the shared document?
Hi Zoey
- Yes they’re both on the master branch. I’ve tried deleting the Shared Docs a few times, and re-sharing. Even tried publishing. Same issue.
- The debugger actually sends the correct content-type (screenshot 1), but the “test endpoint” from the Shared Docs view sends the wrong content-type.
fyi I edited the second screenshot to hide our actual PATCH endpoint
Thanks for the feedback, we are locating and investigating.
Zoey I believe the issue is now resolved!
Thank you!