TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

5 pointsby wing328hkover 2 years ago
Hi all,<p>We&#x27;ve refactored the Python client generator in OpenAPI Generator(http:&#x2F;&#x2F;github.com&#x2F;openapitools&#x2F;openapi-generator). To give it a try, please follow 3 simple steps below:<p>1. Download the Java JAR: https:&#x2F;&#x2F;oss.sonatype.org&#x2F;content&#x2F;repositories&#x2F;snapshots&#x2F;org&#x2F;openapitools&#x2F;openapi-generator-cli&#x2F;6.3.0-SNAPSHOT&#x2F;openapi-generator-cli-6.3.0-20221217.085631-50.jar<p>2. Rename the JAR as &quot;openapi-generator-cli.jar&quot;<p>3. Execute the following command to run the generator for the PetStore API: https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;3_0&#x2F;petstore.yaml<p>Mac&#x2F;Linux:<p>$ java -jar openapi-generator-cli.jar generate -g python-nextgen -i https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;3_0&#x2F;petstore.yaml -o &#x2F;var&#x2F;tmp&#x2F;python-nextgen&#x2F;<p>Windows:<p>$ java -jar openapi-generator-cli.jar generate -g python-nextgen -i https:&#x2F;&#x2F;raw.githubusercontent.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;master&#x2F;modules&#x2F;openapi-generator&#x2F;src&#x2F;test&#x2F;resources&#x2F;3_0&#x2F;petstore.yaml -o C:\tmp\python-nextgen<p>(If JVM is not installed in your machine, please use openapi-genreator-cli docker image instead: https:&#x2F;&#x2F;hub.docker.com&#x2F;r&#x2F;openapitools&#x2F;openapi-generator-cli)<p>If you&#x27;ve any feedback or question, please reply to https:&#x2F;&#x2F;github.com&#x2F;OpenAPITools&#x2F;openapi-generator&#x2F;pull&#x2F;14157 to let me know.

1 comment

samarthr1over 2 years ago
So what has changed between the versions?
评论 #34050229 未加载