Skip to content

Add smallrye-openapi's @APIResponse on built-in ExceptionMappers  #453

Open
@cvgaviao

Description

@cvgaviao

Quarkus with smallrye-openapi can scan for @Provider ExceptionMappers and add them to endpoints that throw that exception.

(quarkusio/quarkus#44035)

@Provider
public class BundleRenderValidationExceptionMapper implements ExceptionMapper<BundleRenderValidationException> {
    @Override
    @APIResponse(
            responseCode = "400",
            description = "Validation of bundle failed",
            content = @Content(mediaType = "application/problem+json", schema = @Schema(implementation = HttpProblem.class))
    )
    public Response toResponse(BundleRenderValidationException exception) {
        return exception.getResponse();
    }
}

Describe the solution you'd like

Would be nice to have those @APIResponse on the built-in ExceptionMappers provided by this extension, so they can be scanned, and the associated HTTP Errors to appear on the generated swagger-ui page

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions