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

Client Code Generation Examples #213

Open
dmitri-s opened this issue Feb 20, 2021 · 1 comment
Open

Client Code Generation Examples #213

dmitri-s opened this issue Feb 20, 2021 · 1 comment

Comments

@dmitri-s
Copy link

dmitri-s commented Feb 20, 2021

Perhaps this issue is somewhat off topic. But it seems it would be beneficial to have an example on thow to apply this OpenAPI description.

For example, I am using swagger-codegen 3.0.0 to generate code based on ghes-2.20.yaml and I am running:
./run-in-docker.sh generate -i /gen/modules/ghes-2.20.yaml -l go -o /gen/out/githubapi -DpackageName=githubapi

But I don't know how to replace {protocol} and {hostname} without chaning the values directly in ghes-2.20.yaml file.

I am new to swagger and I am sure there are other poeple who would apreaciate a little guidance.

@xuorig
Copy link

xuorig commented Oct 5, 2021

Hey @dmitri-s, this will highly depend on your client generation tool. For example https://openapi-generator.tech/docs/usage/ supports a --server-variables option to define those variables. I looked into swagger-codegen and could not find a similar setting. You can also probably change the generated code with your configuration rather than the base YAML file, but both will work.

Good call on adding at least an example though 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants