Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

style=deepObject with an object as a parameter is not supported for proper URL formation #2589

Copy link
Copy link
@greal

Description

@greal
Issue body actions

Problem

I expect the pagination parameter to appear in the URL as &pagination[limit]=10&pagination[offset]=0.

However, the generated URL ends up as &pagination=[object+Object], because object-type query parameters are not supported.

There is no configuration option to override or customize URL generation, which makes it impossible to use objects for forming query parameters.

More details in the documentation - https://spec.openapis.org/oas/v3.1.0.html#style-examples

Is there a plan to add style support?

Scheme

"parameters": [
	{
		"name": "pagination",
		"in": "query",
		"required": true,
		"style": "deepObject",
		"explode": true,
		"schema": {
			"type": "object",
			"title": "PaginationInDto",
			"properties": {
				"offset": {
					"type": "integer"
				},
				"limit": {
					"type": "integer"
				}
			},
			"required": [
				"offset",
				"limit"
			]
		}
	}
],

Example of usage in code

const { data } = useGetCatalogRubric({
	pagination: {
		limit: 10,
		offset: 0,
	},
});
andrew-samson, zagorodnyukwork and hrm1810884

Metadata

Metadata

Assignees

No one assigned

    Labels

    openapi_31OpenAPI 3.1 related issueOpenAPI 3.1 related issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.