Issue
I'm trying to setup a dotnet micro-service backend with a gateway using Ocelote. Doing this as described, Ocelote provides me with multiple swagger definitions (for each micro-service)
Since the API now has multiple definition, each definition has its own defining json file.
How can i generate the API services and Models using openapi-generator-cli in this case. Previously i only had one definition which i generated with the command below, passing it the published json file directly
openapi-generator-cli generate -g typescript-angular -o ./openapi -i http://localhost:xxxx/swagger/docs/v1/project
Additionally how should those definitions be used? Should the services even be split up like this?
Solution
Since there was no fitting tool for my problem or an answer for 6 months, i decided to write an open source tool myself. It is still a WIP but it may already be enough for you, just like it is for my current needs.
Basically what it does is detecting the swagger definitions, generating each of those using the openapi-cli-generator and then merging all generated files together. At the end there are no duplicate files and a single Configuration.
If you find any bugs or unhandled edge cases please contribute via Github!
https://github.com/Deitsch/angler
brew tap deitsch/angler
brew install angler
EDIT
It also includes a fix for openapi-generator/issues/10864 until an official one is released
Answered By - Deitsch
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.