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

[BUG] [SPRING] Tags are not affecting generated code #3334

Closed
oburgosm opened this issue Jul 10, 2019 · 2 comments
Closed

[BUG] [SPRING] Tags are not affecting generated code #3334

oburgosm opened this issue Jul 10, 2019 · 2 comments

Comments

@oburgosm
Copy link

Description

I'm using openapi-generator-maven-plugin to generate spring rest service. According to documentation, tags must affect generated code, but this is not happening

openapi-generator version

v4.0.2

OpenAPI declaration file content or url
...
paths:
  /product:
    get:
      tags:
        - other
...
Command line used for generation
<plugin>
  <groupId>org.openapitools</groupId>
  <artifactId>openapi-generator-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>generate-rest-api</id>
      <goals>
        <goal>generate</goal>
      </goals>
      <phase>generate-sources</phase>
      <configuration>
        <inputSpec>/exampleinput</inputSpec>
        <generatorName>spring</generatorName>
        <configOptions>
          <dateLibrary>java8</dateLibrary>
          <java8>true</java8>
          <interfaceOnly>true</interfaceOnly>
          <reactive>false</reactive>
          <apiPackage>my.apipackage</apiPackage>
          <modelPackage>my.modelpackage</modelPackage>
          <sourceFolder>src/gen/java/main</sourceFolder>
          <serializableModel>true</serializableModel>
        </configOptions>
      </configuration>
    </execution>
  </executions>
</plugin>
@oburgosm
Copy link
Author

I found that exists parameter useTags, with false as default value. If I set it to true, Generated classes are grouping by tags.

In my previous code:

<plugin>
  <groupId>org.openapitools</groupId>
  <artifactId>openapi-generator-maven-plugin</artifactId>
  <executions>
    <execution>
      <id>generate-rest-api</id>
      <goals>
        <goal>generate</goal>
      </goals>
      <phase>generate-sources</phase>
      <configuration>
        <inputSpec>/exampleinput</inputSpec>
        <generatorName>spring</generatorName>
        <configOptions>
          <dateLibrary>java8</dateLibrary>
          <java8>true</java8>
          <interfaceOnly>true</interfaceOnly>
          <reactive>false</reactive>
          <apiPackage>my.apipackage</apiPackage>
          <modelPackage>my.modelpackage</modelPackage>
          <sourceFolder>src/gen/java/main</sourceFolder>
          <serializableModel>true</serializableModel>
          <useTags>true</useTags>
        </configOptions>
      </configuration>
    </execution>
  </executions>
</plugin>

@feferka
Copy link

feferka commented May 11, 2022

found out it is actually issue on other side - openapi generator.
#3334

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

No branches or pull requests

2 participants