Skip to content

Probably controller method parameter servletResponse should be annotated as hidden for openAPI #9

@Unstopabul

Description

@Unstopabul

Currently a controller method looks like this:
public ExampleOut executeExampleIn(@RequestBody ExampleIn examplein,
@RequestParam @Parameter(hidden = true) Map<String, String> params,
HttpServletResponse servletResponse, @RequestHeader Map<String, String> headers) {
kafkaSenderService.send(topicName, examplein, params, servletResponse);
return new ExampleOut();
}

servletResponse parameter is not annotated. As the result, this parameter is listed in the generated api and has pretty long description.

"paths": {
	"/kafka/example_group/example_topic/ExampleIn": {
		"post": {
			"tags": [
				"example"
			],
			"description": "example handler",
			"operationId": "executeExampleIn",
			"parameters": [
				{
					"name": "servletResponse",
					"in": "query",
					"required": true,
					"schema": {
						"type": "object",
						"properties": {
							"trailerFields": {
								"type": "object"
							},
							"status": {
								"type": "integer",
								"format": "int32"
							},
							"headerNames": {
								"type": "array",
								"items": {
									"type": "string"
								}
							},
							"contentType": {
								"type": "string"
							},
							"outputStream": {
								"type": "object",
								"properties": {
									"ready": {
										"type": "boolean"
									},
									"writeListener": {
										"type": "object",
										"writeOnly": true
										...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions