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

README misdocuments default value for parse_response_by_content_type #391

Open
geemus opened this issue Apr 5, 2023 · 1 comment
Open

Comments

@geemus
Copy link
Member

geemus commented Apr 5, 2023

Looks like this may have changed as of 5.0.0. It previously defaulted to false, but now appears to default to true.

See:

|parse_response_by_content_type| false | false | Parse response body to JSON only if Content-Type header is 'application/json'. When false, this always optimistically parses as JSON without checking for Content-Type header. |

There also appear to be a few of defaulting related things to cleanup that look like: # TODO: delete when 5.0.0 released because default value changed

@unicornzero
Copy link

Thank you for reporting this! I'm setting up committee for the first time and your comment helped me get past an issue.

If someone else runs into difficulty with responses of Content-type "application/vnd.api+json", try updating your Committee::Middleware::ResponseValidation options to include parse_response_by_content_type: false

Example error in case someone searches for this:

Committee::InvalidResponse:
       #/components/responses/foobar/content/application~1vnd.api+json/schema expected object, but received String: "{\"data\":{\"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

No branches or pull requests

2 participants