Forum Discussion

bogdanp's avatar
bogdanp
Occasional Contributor
6 years ago

tags not generated in YAML file using swagger-maven-plugin

Hello,

 

I am using swagger-maven-plugin to generate a YAML file based on openAPI annotations.

https://github.com/swagger-api/swagger-core/tree/master/modules/swagger-maven-plugin

The issue is that tags are not generated.

I am using

org.eclipse.microprofile.openapi.annotations.tags

Any suggestions on how I can solve this issue: what I need to change in the pom.xml file?

My pom.xml looks like this:

<plugin>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-maven-plugin</artifactId>
<version>2.0.8</version>
<configuration>
<openapiFilePath>${project.basedir} --this is a PATH to my configuration.yaml file</openapiFilePath>
<outputFileName>result</outputFileName>
<outputFormat>JSONANDYAML</outputFormat>
<outputPath>${project.build.directory}</outputPath>
<prettyPrint>true</prettyPrint>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>resolve</goal>
</goals>
</execution>
</executions>
</plugin>

Thanks a lot,

Bogdan

  • bogdanp's avatar
    bogdanp
    6 years ago

    I used your suggestion and it worked.

    Thanks a lot for helping me :smileyhappy:

     

    However, now I have other issues, like the one below.

     

    Before I used org.eclipse.microprofile.openapi.annotations and now I am using io.swagger.v3.oas.annotations.

     

    There is a problem with the enumeration annotation: I do not know how to write it using io.swagger.v3.oas.annotations, so in the end the YAML output file is not generated properly.

     

    public Response methodName(
    @Parameter(description = ".....")
    @Parameter(in = ParameterIn.QUERY, description = FILTER_DESCRIPTION,
    example = ".....",
    schema = @Schema(
    type = "string",
    description = ".....",
    enumeration = "{\".....\", \".....\", \".....\"}"))
    example = "{\".....\", \".....\", \".....\"}"))
    .............

    Do you have any suggestion in how to solve this?

    Thanks a lot for your help so far :smileyhappy:

    Bogdan

     

  •  

    org.eclipse.microprofile.openapi.annotations.tags
    are part of a different project, please use instead

     

    io.swagger.v3.oas.annotations.tags

     

    • bogdanp's avatar
      bogdanp
      Occasional Contributor

      I used your suggestion and it worked.

      Thanks a lot for helping me :smileyhappy:

       

      However, now I have other issues, like the one below.

       

      Before I used org.eclipse.microprofile.openapi.annotations and now I am using io.swagger.v3.oas.annotations.

       

      There is a problem with the enumeration annotation: I do not know how to write it using io.swagger.v3.oas.annotations, so in the end the YAML output file is not generated properly.

       

      public Response methodName(
      @Parameter(description = ".....")
      @Parameter(in = ParameterIn.QUERY, description = FILTER_DESCRIPTION,
      example = ".....",
      schema = @Schema(
      type = "string",
      description = ".....",
      enumeration = "{\".....\", \".....\", \".....\"}"))
      example = "{\".....\", \".....\", \".....\"}"))
      .............

      Do you have any suggestion in how to solve this?

      Thanks a lot for your help so far :smileyhappy:

      Bogdan