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

[BUG] NotImplementedError: type detection is not implemented for: :json when ID not found #224

Closed
laerciosb opened this issue Apr 21, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@laerciosb
Copy link

Hi, thanks for sharing this amazing gem. I updated to version 0.18.1 and I ran into a problem when trying to create openapi from an endpoint in which a non-existent ID is passed as a parameter. Something like:

context 'when resource not found' do
  let(:resource_id) { 'abc123' }

  before do
    get resource_url(resource_id), as: :json
  end

  it { is_expected.to have_http_status(:not_found) }
end

and error:

RSpec::OpenAPI got errors building 1 requests

#<NotImplementedError: type detection is not implemented for: :json>: #<struct RSpec::OpenAPI::Record http_method="GET", path="/api/v1/resources/abc123", path_params={:format=>:json, :controller=>"api/v1/resources", :action=>"show", :resource_id=>"abc123"}, query_params={}, request_params={}, required_request_params=[], request_content_type="application/json", request_headers=[], summary="Find resource by resource_id", tags=["resources"], operation_id=nil, description="Is expected to respond with a not_found status code (404)", security=nil, deprecated=nil, status=404, response_body={"message"=>"Resource ID: not found"}, response_headers=[], response_content_type="application/json", response_content_disposition=nil>

In the 0.17.0 version everything was working perfectly fine. I hope this continues to evolve. Thank you very much.

@laerciosb laerciosb changed the title ID not found NotImplementedError when ID not found Apr 21, 2024
@laerciosb laerciosb changed the title NotImplementedError when ID not found NotImplementedError: type detection is not implemented for: :json when ID not found Apr 21, 2024
@laerciosb laerciosb changed the title NotImplementedError: type detection is not implemented for: :json when ID not found [BUG] NotImplementedError: type detection is not implemented for: :json when ID not found Apr 21, 2024
@exoego exoego added the bug Something isn't working label Apr 22, 2024
@exoego
Copy link
Owner

exoego commented Apr 22, 2024

Hanami implementation is still broken.
I reported in Hanami router: hanami/router#271

@exoego
Copy link
Owner

exoego commented Apr 22, 2024

Closing as resolved for Rails.
Hanami issue is tracked in #227

@exoego exoego closed this as completed Apr 22, 2024
@exoego exoego added this to the v0.18.2 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants