What configuration needed in pom.xml file to generate multiple Yaml file based on package using openapi

69 Views Asked by At

Our project is based on code first approach and we are using openapi to generate documentation. What configuration do we need in pom.xml file to generate seperate yaml file according to the package. my pom.xml is -

    
<!--    other dependencies -->
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>2.0.8</version>
        </dependency>
        <!--    other dependencies -->

<build>
    <plugins>   
            <plugin>
        <groupId>io.swagger.core.v3</groupId>
                <artifactId>swagger-maven-plugin</artifactId>
                <version>2.2.20</version>
<configuration> 
                        <outputPath>${project.basedir}/swagger/out</outputPath>
                    <outputFileName>test_swagger</outputFileName>
                    <outputFormat>YAML</outputFormat>           
    <!--  <apiSources>
    <apiSource>
        <locations>
            <location>com.xyz.rest</location>
            <location>com.pqr.rest</location>
        </locations>
        <host>abc.com.au</host>
        <info>
            <title>XYZ Services</title>
            <version>${project.version}</version>
            <description>This files contains all XYZ related Services</description>
            <termsOfService>...</termsOfService>
            <contact>
                <email>[email protected]</email>
                <name>ABC</name>
                <url>email:[email protected]</url>
            </contact>
        </info>
        <swaggerDirectory>${project.basedir}/swagger/out</swaggerDirectory>
        <swaggerFileName>SwaggerOutput/swagger_abc</swaggerFileName>
        <attachSwaggerArtifact>true</attachSwaggerArtifact>
        <securityDefinitions>
            <securityDefinition>
                <name>basicAuth</name>
                <type>basic</type>
            </securityDefinition>
        </securityDefinitions>
        <outputFormats>yaml</outputFormats>
    </apiSource>
    <apiSource>
        
        detail to generate second yaml file for other package
                            
    </apiSource>
    <apiSources>
        -->
    </configuration>

tried many thing to generate multiple yaml file but currently it is generating only one yaml file.

0

There are 0 best solutions below