You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using the springdoc.override-with-generic-response=true property after version 1.6.7 methods annotated with @ResponseStatus and @ExceptionHandler are no longer included in the swagger definition.
This applies for handler methods inside either the @RestController class or a @ControllerAdvice class for handling global exceptions.
openapi: 3.0.1
info:
title: Hello API
description: An API for saying hello.
version: 1.0-SNAPSHOT
servers:
- url: http://0.0.0.0:8080
description: Generated server url
tags:
- name: Hello Api
paths:
/api/hello:
get:
tags:
- Hello Api
summary: Says hello
operationId: getHello
responses:
"200":
description: OK
content:
text/plain:
schema:
type: string
components: {}
Expected behavior
It is expected that every @ExceptionHandler method that is annotated with @ResponseStatus should show as a response for every API path in the swagger doc when springdoc.override-with-generic-response=true
Expected output
openapi: 3.0.1
info:
title: Hello API
description: An API for saying hello.
version: 1.0-SNAPSHOT
servers:
- url: http://0.0.0.0:8080
description: Generated server url
tags:
- name: Hello Api
paths:
/api/hello:
get:
tags:
- Hello Api
summary: Says hello
operationId: getHello
responses:
"403":
description: Forbidden
content:
'*/*':
schema:
type: string
"500":
description: Internal Server Error
content:
'*/*':
schema:
type: string
"200":
description: OK
content:
text/plain:
schema:
type: string
components: {}
Screenshots
Here is an example of the expected output where the errors are shown in the endpoint documentation:
When using 1.6.8 or above the error statuses are missing:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
When using the
springdoc.override-with-generic-response=true
property after version1.6.7
methods annotated with@ResponseStatus
and@ExceptionHandler
are no longer included in the swagger definition.This applies for handler methods inside either the
@RestController
class or a@ControllerAdvice
class for handling global exceptions.To Reproduce
Steps to reproduce the behavior:
2.7.2
springdoc-openapi-ui
Versions:1.6.8, 1.6.9, 1.6.10
Expected behavior
@ExceptionHandler
method that is annotated with@ResponseStatus
should show as a response for every API path in the swagger doc whenspringdoc.override-with-generic-response=true
Screenshots

Here is an example of the expected output where the errors are shown in the endpoint documentation:
When using

1.6.8
or above the error statuses are missing:Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: