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

Handle schema errors without failing the build #27

Merged
merged 2 commits into from
Jun 12, 2021
Merged

Conversation

bf4
Copy link
Contributor

@bf4 bf4 commented Jun 11, 2021

Feature: Don't crash the build :) Skip bad records.

One of our requests raises "NotImplementedError: type detection is not implemented for: #<JSONAPI::Exceptions::BadRequest: JSONAPI::Exceptions::BadRequest>>" which causes the whole build to fail.

The specific error is " request_params={"_parser_exception"=>#<JSONAPI::Exceptions::BadRequest: JSONAPI::Exceptions::BadRequest>},"

I was thinking it would be nice to use objects here instead of block scope, but that's for another day.

For example, then I could more easily write my own hook logic that didn't rely on the example.metadata[:type] == :request

lib/rspec/openapi/hooks.rb Outdated Show resolved Hide resolved
Copy link
Collaborator

@k0kubun k0kubun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@k0kubun k0kubun merged commit 29d556a into exoego:master Jun 12, 2021
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