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] Referenced schemas for query params won't serialize as expected #739

Open
1 of 3 tasks
andreacasarin opened this issue Mar 27, 2024 · 0 comments
Open
1 of 3 tasks

Comments

@andreacasarin
Copy link

andreacasarin commented Mar 27, 2024

Describe the bug

When describing an object to pass trough query params via referenced schema (in swagger_helper.rb) it won't serialize with the same style as it was described in the test case itself.

Steps to Test or Reproduce

Given let(:q) {{ name_eq: 'foo' }}:

      parameter name: :q, in: :query, schema: {
        type: :object,
        properties: {
          name_eq: { type: :string }
        }
      }

Will result in url/q[name_eq]=foo.

        schemas: {
          q: {
            type: :object,
            properties: {
              name_eq: { type: :string }
            }
          }
        }

        parameter name: :q, in: :query, style: :deepObject, schema: { '$ref' => '#/components/schemas/q' }

Will result in url?q={:name_eq=%3E%22foo%22}.

Expected behavior

They should both behave the first way as per Swagger docs: https://swagger.io/docs/specification/describing-parameters/#query-parameters and https://swagger.io/docs/specification/serialization/.

Dependency versions

Latest versions.

Relates to which version of OAS (OpenAPI Specification)

  • OAS2
  • OAS3
  • OAS3.1
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

No branches or pull requests

1 participant