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

Can we have the descriptor file generated in a different folder? #80

Closed
mv93 opened this issue May 22, 2020 · 3 comments
Closed

Can we have the descriptor file generated in a different folder? #80

mv93 opened this issue May 22, 2020 · 3 comments

Comments

@mv93
Copy link

mv93 commented May 22, 2020

Hi,

I'm using this tool to convert my xml to open-api descriptor format and then exposing the same via swagger ui.

This is how im generating:

                    <execution>
                        <id>openapi</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <workingDirectory>..</workingDirectory>
                            <executable>node</executable>
                            <arguments>
                               <argument>node_modules/odata-openapi/lib/cli.js</argument>
                                <argument>${project.basedir}/src/main/resources/edmx/RequisitionService.xml</argument>                                                  
                            </arguments>											
                        </configuration>
                    </execution>

So my open api file is getting generated in the same folder as the xml. But i want to move my open api file to a different folder and expose only that as a static resource. For this im using the maven resource plugin. But i wanted to know if there is a better way to move the generated file?
I saw a parameter called basePath. can we use this to specify the directory in which we need to generated file?

@ralfhandl
Copy link
Contributor

Hi @mv93

You can use the -t parameter to specify the name and path of the output file. Or just move it where you want to have it. Not using maven myself, so can’t help there.

The --basePath parameter influences the server URL within the generated OpenAPI output.

@mv93
Copy link
Author

mv93 commented May 26, 2020

Thank you, this worked for me.
This is how I used it in my pom.xml:

<arguments>
<argument>node_modules/odata-openapi/lib/cli.js</argument>
<argument>${project.basedir}/src/main/resources/edmx/RequisitionService.xml</argument>  
<argument>-t</argument>	
<argument>${project.basedir}\src\main\resources\static\RequisitionService.openapi3.json</argument>
</arguments>

@mv93 mv93 closed this as completed May 26, 2020
@ralfhandl
Copy link
Contributor

@mv93 Thanks for sharing the solution!

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

2 participants