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

Multipath filterproperties skipped when generating json in springboot #10257

Open
hspatel09 opened this issue Jan 16, 2025 · 0 comments
Open

Comments

@hspatel09
Copy link

Q&A (please complete the following information)

  • OS: [macOS / Any]
  • Browser: [Any]
  • Version: [15.2]
  • Method of installation: [e.g. mvn spring-boot:run]
  • Swagger-UI version: [5.18.2]
  • Swagger/OpenAPI version: [ OpenAPI 3.0]

Content & configuration

@GetMapping(value = {
"/mine",
"/mine/{filterProperty1}/{filterValue}",
"/mine/{filterProperty1}/{filterProperty2}/{filterValue}",
"/mine/{filterProperty1}/{filterProperty2}/{filterProperty3}/{filterValue}"
})
@responsebody
public ResponseEntity getNestedFiltered(HttpServletRequest request) throws JsonProcessingException {
....
}

Example Swagger/OpenAPI definition:

# your YAML here

Here is generated json snippet which ignores filterProperty1 and filterValue as params. Not sure why ?
it does the same thing for /{filterProperty2}/{filterProperty3} when it generates it skips all of them.

"/preferences/mine/{filterProperty1}/{filterValue}" : {
"get" : {
"tags" : [ "Preferences" ],
"operationId" : "getNestedFiltered_1",
"responses" : {
"500" : {
"description" : "Internal Server Error",
"content" : {
"/" : {
"schema" : {
"type" : "string"
}
}
}
},
"413" : {
"description" : "Payload Too Large",
"content" : {
"/" : {
"schema" : {
"type" : "string"
}
}
}
},

Swagger-UI configuration options:

SwaggerUI({
  // your config options here
})
?yourQueryStringConfig

Describe the bug you're encountering

To reproduce...

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

it should produce snippet as shown below.

"/preferences/mine/{filterProperty1}/{filterValue}" : {
"get" : {
"tags" : [ "Preferences" ],
"operationId" : "getNestedFiltered_1",
"parameters": [
{
"name": "filterProperty1",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "filterValue",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
]
responses" : {
"500" : {
"description" : "Internal Server Error",
"content" : {
"/" : {
"schema" : {
"type" : "string"
}
}
}
},

getNestedFiltered

Screenshots

Additional context or thoughts

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