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