Jump to content

Hacker News - Show HN: Auto-Generate Python REST API Clients Using OpenAPI Generator


Neo

Recommended Posts

Hi all,

We've refactored the Python client generator in OpenAPI Generator(http://github.com/openapitools/openapi-generator). To give it a try, please follow 3 simple steps below:

1. Download the Java JAR: https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.3.0-SNAPSHOT/openapi-generator-cli-6.3.0-20221217.085631-50.jar

2. Rename the JAR as "openapi-generator-cli.jar"

3. Execute the following command to run the generator for the PetStore API: https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml

Mac/Linux:

$ java -jar openapi-generator-cli.jar generate -g python-nextgen -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o /var/tmp/python-nextgen/

Windows:

$ java -jar openapi-generator-cli.jar generate -g python-nextgen -i https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o C:\tmp\python-nextgen

(If JVM is not installed in your machine, please use openapi-genreator-cli docker image instead: https://hub.docker.com/r/openapitools/openapi-generator-cli)

If you've any feedback or question, please reply to https://github.com/OpenAPITools/openapi-generator/pull/14157 to let me know.


Comments URL: https://news.ycombinator.com/item?id=34028401

Points: 1

# Comments: 0

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...