Open ppKrauss opened 7 years ago
@ppKrauss thanks for the suggestion. I think it's a good idea 👍 and I'm sure developers are using Apache or Ngnix as API gateway would welcome the new generator to automate the config generation.
Let us know if you need help adding the new generators.
Thanks @wing328 (!)... Well, I need to do some homework and review contrib guide... But, ... hum, yes I need help to adding the new generators.
There are some client or server code here that is the "most similar" to my mustache needs?
How to, after git clone
swagger-codegen, with simple command line (I have no Jave IDE!), in a UBUNTU 16 LTS, run the generator to do my tests?
@ppKrauss sorry I missed your reply.
There are some client or server code here that is the "most similar" to my mustache needs?
I would suggest you start with the documentation generators, which generate only 1 or several files similar to configuration files that you want to generate.
How to, after git clone swagger-codegen, with simple command line (I have no Jave IDE!), in a UBUNTU 16 LTS, run the generator to do my tests?
Please do the following
git clone https://github.com/swagger-api/swagger-codegen
cd swagger-codegen
(make some changes)
mvn clean install -DskiptTests
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l new_generator_name
Apache and Nginx have a lean language to express API Gateways,
Description
The "API Gateway" (at server-side) acts as a dedicated orchestration layer for all your backend APIs, to separate orchestration from implementation concerns. In this example the gateway is a Nginx script generated from the OpenAPI specifications of each microservice (adding some
x-
properties when need ... and perhaps someopenapi-gateway.json
file for complex cases).EXAMPLE: extracted from here,
It is obtained by tpl01-baseBreak template and
petstore-expanded.json
as input.Swagger-codegen version
Suggestion to add Apache-rewrite and Nginx-rewrite languages as new targets in codegen.
Swagger declaration file content or url
See this this adapted petstore-expanded.json example: with
x-rewrite_regex
,x-proxy_url
and new endpoint adictions. The specific mustache templates generates the code.Related issues
It is a enhance suggestion... How to discuss this kind of suggestion?