drf-openapi-tester icon indicating copy to clipboard operation
drf-openapi-tester copied to clipboard

Support for application/vnd.api+json content type in responses

Open darduf opened this issue 3 years ago • 3 comments

We use application/vnd.api+json content type for endpoint responses. Currently getting the error below when running tests:

 File "../python3.9/site-packages/openapi_tester/schema_tester.py", line 92, in get_key_value
    raise UndocumentedSchemaSectionError(
openapi_tester.exceptions.UndocumentedSchemaSectionError: Error: Unsuccessfully tried to index the OpenAPI schema by `application/json`. 

No `application/json` responses documented for method: get, path: /api/#####/

darduf avatar Sep 05 '22 08:09 darduf

Ah ok yes this is probably not accounted for. Would you be interested in creating a fix?

sondrelg avatar Sep 05 '22 08:09 sondrelg

Is this no longer an issue for you @darduf? 🙂

sondrelg avatar Sep 26 '22 19:09 sondrelg

Is this no longer an issue for you @darduf? 🙂

This is still an issue for us as we use content type application/vnd.api+json. I will try to get a PR in for this also. I think we can use regex here again to allow for either content types.

application/vnd.api+json or application/json

darduf avatar Sep 26 '22 19:09 darduf