Skip to content

Handle schema errors without failing the build - #27

Merged
k0kubun merged 2 commits into
exoego:masterfrom
bf4:patch-2
Jun 12, 2021
Merged

Handle schema errors without failing the build#27
k0kubun merged 2 commits into
exoego:masterfrom
bf4:patch-2

Conversation

@bf4

@bf4 bf4 commented Jun 11, 2021

Copy link
Copy Markdown
Contributor

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

Comment thread lib/rspec/openapi/hooks.rb Outdated

@k0kubun k0kubun left a comment

Copy link
Copy Markdown
Collaborator

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