interagent / committee

A collection of Rack middleware to support JSON Schema.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

README misdocuments default value for `parse_response_by_content_type`

geemus opened this issue · comments

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

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\":\"