Generating both KrakenD configuration and OpenAPI documentation is possible, but...
You should precisely define your use case:
Do you want to generate krakend.json config from OpenAPI just as no-op proxy? (see an example script)
Are you willing to adopt another (custom) format? (see openapi2krakend)
Do you want to generate OpenAPI documentation from KrakenD config? If so, do you need just a list of endpoints or do you want also to have defined descriptions, examples and types (!) in one file?
You should (at least try to) write the script to generate the configuration by yourself to suit your needs.
Consider a usage of KrakenD Studio that has the OpenAPI generator plugin.
It can look like a good idea, but the devil is in the details and you should analyse your requirements because these two files have totally different purposes. I can only suggest you write such a transformation script (as I did) which should be like "5 minutes of work" and then go to the deep.
Edit: We have selected a subset of KrakendD features and implemented our own configuration generator (from OAS). We use tags with a custom route-to/ prefix for metadata, a definition could look like this:
Generating both KrakenD configuration and OpenAPI documentation is possible, but...
krakend.json
config from OpenAPI just asno-op
proxy? (see an example script)It can look like a good idea, but the devil is in the details and you should analyse your requirements because these two files have totally different purposes. I can only suggest you write such a transformation script (as I did) which should be like "5 minutes of work" and then go to the deep.
Edit: We have selected a subset of KrakendD features and implemented our own configuration generator (from OAS). We use
tags
with a customroute-to/
prefix for metadata, a definition could look like this: