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

Register "application/vnd.api+json" as media type #37

Closed

Conversation

pvcarrera
Copy link
Contributor

Currently, there is no media type registered for the JSON:API specification. As a result, JSON:API responses are parsed using the default parser, which treats the response body as a string. When an OpenAPI specification with a JSON:API response expects an object, the matchers fail with the error "The instance must be of type object, but was string".

This change registers the JSON:API media type application/vnd.api+json and configures it to use the existing JSONParser to parse JSON:API responses.

This change allows JSON:API response bodies to be parsed.
@pvcarrera
Copy link
Contributor Author

When I run these specs on the main branch I get the same errors so I'm not sure if the errors are related to my changes

@skryukov
Copy link
Owner

Thanks for the PR @pvcarrera, could you check #38 for more general approach?

@skryukov
Copy link
Owner

Closing in favor of #38

@skryukov skryukov closed this Dec 25, 2024
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 this pull request may close these issues.

2 participants