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

Explode object for object query parameters #206

Open
felixdo opened this issue Jun 18, 2024 · 1 comment
Open

Explode object for object query parameters #206

felixdo opened this issue Jun 18, 2024 · 1 comment

Comments

@felixdo
Copy link

felixdo commented Jun 18, 2024

Trying to make spring pageable parameters work. The generated OpenAPI schema is:

"parameters": [
          {
            "name": "pageable",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Pageable"
            }
          }
[...]
"Pageable": {
        "type": "object",
        "properties": {
          "page": {
            "minimum": 0,
            "type": "integer",
            "format": "int32"
          },
          "size": {
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          },
          "sort": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }

And spring wants that as ?page=...&size=..... Afaict this is the "exploded, form" style for openapi serialization of object query parameters, and this is the expected format for this combination. From martian I get however: pageable%5Bpage%5D=10. Not sure if this is an easy fix, there are a gazillion different ways to represent parameters in the openapi spec.

@felixdo
Copy link
Author

felixdo commented Jun 18, 2024

Oh, i just see... this is then actually handled by the backend, in my case clj-http. Will check there.

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