Ask a Question

Child @BeanParam not working after upgrade swagger-jaxrs2-jakarta to 2.2.7

leonardolima
New Contributor

Child @BeanParam not working after upgrade swagger-jaxrs2-jakarta to 2.2.7

Hi everyone... 


I'm in a journey to upgrade swagger-jaxrs2-jakarta 1.6.8 to 2.2.7, I got almost everything working except some object parameters that should be exploded as inputs in the Swagger-ui and them still be interpreted as json input...

 

In my resource definition I've this method...

Response getContent(@BeanParam MyCustomRequest myRequest);


And them I've the definition of MyCustomRequest

public class MyCustomRequest extends Request {

}

public class Request {
  @BeanParam
  @Builder.Default
  private Pagination pagination = new Pagination();
}

public class Pagination {

  @QueryParam("limit")
  @DefaultValue("200")
  private Integer limit = 200;

  @QueryParam("offset")
  @DefaultValue("0")
  private Integer offset = 0;
}

 

Using the version: 1.6.8, swagger-ui shows: 

leonardolima_0-1671460892397.png

 

After the upgrade... 

leonardolima_1-1671460928925.png

 

Anyone already got this issue?? And can help me? 

My best regards,

Leonardo Lima

 

1 REPLY 1
leonardolima
New Contributor

{
	"openapi": "3.0.1",
	"info": {
		"title": "my-application",
		"description": "app",
		"version": "1.0.1-SNAPSHOT"
	},
	"servers": [{
		"url": "/app"
	}],
	"tags": [{
		"name": "Endpoint",
		"description": "Endpoint"
	}],
	"paths": {
		"/app/get/{brand}/something": {
			"get": {
				"tags": [
					"something"
				],
				"summary": "something",
				"operationId": "search_1",
				"parameters": [{
						"name": "name",
						"in": "path",
						"required": true,
						"schema": {
							"type": "string"
						}
					},
					{
						"name": "limit",
						"in": "query",
						"schema": {
							"$ref": "#/components/schemas/Pagination"
						}
					},
					{
						"name": "offset",
						"in": "query",
						"schema": {
							"$ref": "#/components/schemas/Pagination"
						}
					},
					{
						"name": "context",
						"in": "query",
						"schema": {
							"type": "string",
							"default": "default"
						}
					}
				],
				"responses": {
					"200": {
						"description": "Sucesso",
						"content": {
							"application/json": {
								"schema": {
									"$ref": "#/components/schemas/SomethingResponse"
								}
							}
						}
					},
					"400": {
						"description": "Bad request"
					},
					"404": {
						"description": "Not found"
					}
				}
			}
		}
	},
	"components": {
		"schemas": {
			"SomethingResponse": {},
			"Pagination": {}
		}
	}
}

 

This is the result generated... I'm still without any clue of how resolve this 😞

cancel
Showing results for 
Search instead for 
Did you mean: