Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media type 'application/vnd.api+json' is not supported. #224

Closed
sarangsbabu367 opened this issue Mar 22, 2020 · 2 comments · Fixed by #622
Closed

Media type 'application/vnd.api+json' is not supported. #224

sarangsbabu367 opened this issue Mar 22, 2020 · 2 comments · Fixed by #622

Comments

@sarangsbabu367
Copy link

The content type application/vnd.api+json is not supported in openapi-core, When i added,
'application/vnd.api+json': json_loads, in /deserializing/media_types/factories.py it solved the problem. Can you add this media-type ?
image

@sarangsbabu367
Copy link
Author

There is an option for adding custom-custom_media_type_deserializers along with RequestValidator object.

@SaturnIC
Copy link

SaturnIC commented Jul 12, 2023

In the openapi-core v 0.18.0 the necessary call is:

import json
from openapi_core import unmarshal_request, validate_request, validate_response
from openapi_core.contrib.requests import RequestsOpenAPIRequest, RequestsOpenAPIResponse

vndapi_media_type ={'application/vnd.api+json': json.loads}
validate_request(openapi_request, spec=specification, cls=V31RequestValidator, extra_media_type_deserializers=vndapi_media_type)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants