Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating component definition #67

Open
ktalebian opened this issue Nov 25, 2020 · 0 comments
Open

Creating component definition #67

ktalebian opened this issue Nov 25, 2020 · 0 comments

Comments

@ktalebian
Copy link

I'm using the default configuration in my pom:

<configuration>
    <resourcePackages>
        <resourcePackage>com.myapp.resource</resourcePackage>
    </resourcePackages>
    <outputDirectory>${basedir}/target/</outputDirectory>
    <outputFilename>my-api</outputFilename>
    <outputFormats>JSON,YAML</outputFormats>
    <prettyPrint>true</prettyPrint>
</configuration>

I need to manually define certain of the external component schemas because our code-gen library is not able to understand what this plugin generates. For that reason, for such modules, I'm annotating the component with @Schema(ref = "PackageName"). This plugin then successfully generates the open-api definition and references the components correctly.

However, the component itself becomes a self reference component:

components:
  schema:
    PackageName:
      $ref: '#/components/schemas/PackageName'

Instead, I want to be able to define this component myself so I can set it to be

components:
  schema:
    PackageName:
      type: object
      x-jvm-type: PackageName
      description: My awesome description
      example: 1234

I created a feature request here #66 since securitySchema can now be defined in the pom configuration. In the meantime, I wanted to know if there are any workarounds to get this to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant