Reputation: 1763
I have one rest endpoint which uses one class as the openapi schema:
import javax.ws.rs.Path;
import org.eclipse.microprofile.openapi.annotations.media.Schema;
import org.eclipse.microprofile.openapi.annotations.responses.APIResponse;
@Path("/orders")
@RequestScoped
public class OrdersRest {
@APIResponse(responseCode = "200", description = "Create a new order", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = OrderDto.class)) })
public Response create(OrderDto request) throws SessionNotFound {
The OrderDto class has one attribute that refers to another class, that exists on my project:
public class SessionDto {
private SessionSettingsProperties[] sessionSettingsProperties;
When I access the swagger-ui, I am receiving the error:
Errors
Resolver error at paths./session.get.responses.200.content.application/json.schema.properties.sessionSettingsProperties.items.$ref
Could not resolve reference: Could not resolve pointer: /components/schemas/SessionSettingsProperties does not exist in document
I'm using the Quarkus 1.13.1.Final version.
I've found this issue in Quarkus project that looks similar, but I believe is not exactly the same problem I have.
Upvotes: 2
Views: 1859
Reputation: 1763
I was able to fix my problem including one org.eclipse.microprofile.openapi.annotations.media.Schema annotation in my field of the SessionDto class like this:
import org.eclipse.microprofile.openapi.annotations.media.Schema;
public class SessionDto {
@Schema(implementation = SessionSettingsProperties[].class)
private SessionSettingsProperties[] sessionSettingsProperties;
Upvotes: 1