Skip to content

No OpenAPI schema generated for Class annotated with @Schema #1145

@michaelkoepf

Description

@michaelkoepf

Hi,

Disclaimer: I am not sure if this issue should be opened in this repo or rather there. Trying it here first.

I use io.quarkus:quarkus-smallrye-openapi via the Quarkus Operator SDK extensions BOM (version details below). I have an object annotated with org.eclipse.microprofile.openapi.annotations.media.Schema.

package com.example;

import org.eclipse.microprofile.openapi.annotations.media.Schema;

@Schema(description = "Policy specification.")
public final class TestPolicySpec {

  @Schema(description = "Value.")
  private String value;

  public String getValue() {
    return value;
  }

  public void setValue(final String value) {
    this.value = value;
  }
}

For this object, the OpenAPI spec should be generated. My configuration for smallrye-openapi is as follows.

quarkus.smallrye-openapi.store-schema-directory=./openapi-spec
quarkus.smallrye-openapi.auto-add-server=false

When running the build (./gradlew clean build), the respective OpenAPI files are generated, but do not contain the annotated object.

---
openapi: 3.1.0
paths: {}
info:
  title: Generated API
  version: "1.0"

Version details:

quarkusPluginVersion=3.24.2
quarkusPlatformVersion=3.24.2

The complete example source code can be found here: https://github.com/michaelkoepf/openapi-gen-test

Thank you.

--
Best,
Michael

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions