OpenAPI (Swagger) Configuration Quarkus

Viewed 60

Good Night. I am new to Quarkus and I am configuring the swagger through OpenApi, however I have doubts about its configuration, for example I work with Request/Response through object composition, however, if I wanted to hide some classes how to do it and that I only know show the ones I want, example:

enter image description here

I want to hide those Era, CalendarDate and Date classes, how do I do that?

I would also like to add a description to the fields, in my case I only use the post method, but what would be the label to add a description to the fields?:

I tried with the @Parameters tag to add a description to the accountNumberCustomerAccount field, however, it is not reflected in the description of the schemas in the OpenApi:

package org.tmve.subscriber.domains.request.body;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.eclipse.microprofile.openapi.annotations.parameters.Parameter;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data

@Schema(name="UpdatePrepaidSubscriberPlanBSRequest", description = "Campos de entradas para el cambio de plan")
public class UpdatePrepaidSubscriberPlanBSRequest {

    @NotNull
    @Size(min=1,max=10)
    @NotEmpty
    @Pattern(regexp="^\\d+$")
    @JsonProperty("subscriberId")
    private String subscriberId;

    @NotNull
    @NotEmpty
    @Size(min=1,max=12)
    @Parameter(description="Numero de cuenta cliente", required = true)
    private String accountNumberCustomerAccount;

    @NotNull
    @NotEmpty
    private String planCode;

    @NotNull
    @NotEmpty
    private String coverageZone;

    @NotNull
    @NotEmpty
    private String salesAgent;

}

However, at the OpenApi level I get something like this:

enter image description here

Greetings and thanks in advance

1 Answers
Related