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

fix: encode query params when use schema type #725

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JohnnyKei
Copy link
Contributor

Problem

When use schema: { type: : string } with openAPI 3, it does not encode.
Then it causes

Failure/Error: raise InvalidURIError, "URI must be ascii only #{uri.dump}"

rspec -format Rswag::Specs::SwaggerFormatter overrides metadata type to schema: { type: :xxx}

(operation_nodes + path_nodes + [header_node]).each do |node|
if node && node[:type] && node[:schema].nil?
node[:schema] = { type: node[:type] }
node.delete(:type)
end

Solution

encode query parameter when using oepnAPI version 3 with schema type.

extends #621

This concerns this parts of the OpenAPI Specification:

The changes I made are compatible with:

  • OAS2
  • OAS3
  • OAS3.1

Related Issues

Links to any related issues.

Checklist

  • Added tests
  • Changelog updated
  • Added documentation to README.md
  • Added example of using the enhancement into test-app

Steps to Test or Reproduce

Outline the steps to test or reproduce the PR here.

@romanblanco romanblanco added this to the Gem 2.X.0 milestone Feb 11, 2024
encode query parameter when using oepnAPI version 3 with  schema type.

rswag#621
@JohnnyKei
Copy link
Contributor Author

JohnnyKei commented Feb 13, 2024

CI test failed, so rebased latest master branch.

Copy link

@melodevbr melodevbr left a comment

Choose a reason for hiding this comment

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

LGTM

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.

None yet

3 participants