Skip to content

OpenAPI should list a 400 error code on certain conditions #27376

@pilhuhn

Description

@pilhuhn

Description

Suppose you have

    @POST
    @Path("/example")
    public void addBar(MyBean myBean) {
        System.out.println(myBean.bar);
    }

Then OpenAPI should list a 400 code in the responses section (unless the user explicitly provides one), as RestEasy will reject the request when the passed data can't be de-serialized into myBean.

If a @Valid annotation is present, the same applies, but it means that the constraints inside the bean are checked as well. E.g.

public class MyBean {

    @NotNull @Length(max = 6, min = 2)
    String bar;

Here the component.schema should list the min/max length and also the 400 error should be listed if not done before

Related to #27375

Implementation ideas

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions