Skip to content

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

@greal

Description

@greal

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,
	},
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    openapi_31OpenAPI 3.1 related issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions