Wildcard content-type "*/*" leads to unparsed JSON responses
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
The bug is that a response declared with the wildcard content-type */* is not parsed, so an object schema fails against a String body. Start where the response parser is chosen from the OAD's response content-type, and check how the wildcard is handled there. Done means a */* response with type: object gets its body parsed and validates. The issue has been open for about a year with one comment and no answer, so confirm the expected behaviour with the maintainer first.
Written by the indexing model from the issue text.
Description
Currently openapi_first picks a response parser based on the content-type defined in your OAD. If you specify a content-type like application/json: your response will be parsed with JSON.
When your OAD has a response content-type specified like */* openapi_first current does not parse the response body at all and just returns the plain body (as a String).
This leads to having a response definition like this always failing validation, because a the string (String) is not an object (Hash):
content:
"*/*":
schema:
type: object
- Dominant language
- Ruby
- Stars
- 222
- Forks
- 27
- Avg merge
- 17h 15m
- Merged PRs (30d)
- 6
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ahx/openapi_first
-
Multipart file uploads fail validation with ActionDispatch::Request (UploadedFile isn't a Hash)Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ahx/openapi_first#516 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
ahx/openapi_first#484 · 4 comments · 1 reaction ·
-
OpenAPI 3.2 supportMay be free again A pull request for this issue was closed without being merged. Openenhancement
Difficulty 4/5 3-5 days Newbie friendliness 22/100
ahx/openapi_first#469 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ahx/openapi_first#458 · 4 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
ahx/openapi_first#425 ·
All issues in ahx/openapi_first
Similar issues
-
Bug Ruby
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
getsentry/sentry-ruby#3211 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
internetee/registry#2984 ·
Maintainers usually reply within 6 days
-
interest-zsv
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
hitobito/hitobito_zsv#6 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ecosyste-ms/issues#862 ·
Maintainers usually reply within 1 day
-
Redis Lua error `@user_script:52: ERR value is not an integer or out of range` when `window_size` is configuredPossibly taken @mimosa claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day