Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Using Swagger Codegen

Once you have generated your swagger.json file, you can use it to generate your server stubs or client SDKs using Swagger codegen.

Here is an example that will generate PHP code.

docker run --rm \
  -v ${PWD}:/local \
  swaggerapi/swagger-codegen-cli-v3:3.0.5 generate \
  -i http://192.168.16.21/spec \
  -l "php" \
  -o /local/out/code

References

Last updated: 12th May 2021
First published: 14th March 2019

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch