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

Enable response validation per OpenAPI spec #1407

Open
mjgiarlo opened this issue Feb 26, 2020 · 6 comments
Open

Enable response validation per OpenAPI spec #1407

mjgiarlo opened this issue Feb 26, 2020 · 6 comments

Comments

@mjgiarlo
Copy link
Member

  1. Uncomment # config.middleware.use Committee::Middleware::ResponseValidation, schema_path: 'openapi.yml' in config/application.rb
  2. Run the specs and watch the failures
  3. Fix the failures
@aaron-collier
Copy link
Contributor

This is blocked by:

interagent/committee#257

Since some of our responses are XML and the committee gem requires responses to be JSON for validation.

@aaron-collier aaron-collier changed the title Enable response validation per OpenAPI spec [BLOCKED] Enable response validation per OpenAPI spec Apr 7, 2020
@jmartin-sul jmartin-sul changed the title [BLOCKED] Enable response validation per OpenAPI spec Enable response validation per OpenAPI spec Oct 20, 2022
@jmartin-sul
Copy link
Member

i believe this may now be unblocked, as the committee issue linked from april 2020 appears to have been fixed in august 2020. @aaron-collier, i'm going to move this into "in progress", but if you'd prefer to unassign yourself and kick it back to "ready", no objection from me. there may be other blockers besides interagent/committee#257, but seems worth a re-visit to find out what specifically.

@aaron-collier
Copy link
Contributor

@jmartin-sul just saw this in the in-progress column, happy to pick it back up.

@justinlittman
Copy link
Contributor

For what it is worth, I believe that for other apps, we only do response validation during tests.

@justinlittman
Copy link
Contributor

@aaron-collier
Copy link
Contributor

I think this is still blocked by interagent/committee#300

Well, that ticket is a feature request for the same issue I'm seeing working on this:

     Committee::InvalidResponse:
       #/components/schemas/ContentDiff expected object, but received String: "<?xml version=\"1.0\"?>\n<fileInventoryDifference objectId=\"xx123yy9999\" differenceCount=\"0\" basis=\"v0\" other=\"new-contentMetadata-all\" reportDatetime=\"2022-11-01T20:05:54Z\">\n  <fileGroupDifference groupId=\"content\" differenceCount=\"0\" identical=\"0\" copyadded=\"0\" copydeleted=\"0\" renamed=\"0\" modified=\"0\" added=\"0\" deleted=\"0\">\n    <subset change=\"identical\" count=\"0\"/>\n    <subset change=\"copyadded\" count=\"0\"/>\n    <subset change=\"copydeleted\" count=\"0\"/>\n    <subset change=\"renamed\" count=\"0\"/>\n    <subset change=\"modified\" count=\"0\"/>\n    <subset change=\"added\" count=\"0\"/>\n    <subset change=\"deleted\" count=\"0\"/>\n  </fileGroupDifference>\n</fileInventoryDifference>\n"

@aaron-collier aaron-collier removed their assignment Nov 2, 2022
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.

5 participants