From bd329c13fb334b669efcab4f6ed7f24615cffe9b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 12 Oct 2020 15:21:34 +0800 Subject: [PATCH] update website (#7655) --- README.md | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 66e95b3ec751..d53b1f9d9320 100644 --- a/README.md +++ b/README.md @@ -255,7 +255,7 @@ To install, run `brew install openapi-generator` Here is an example usage to generate a Ruby client: ```sh -openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby -o /tmp/test/ +openapi-generator generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby -o /tmp/test/ ``` To reinstall with the latest master, run `brew uninstall openapi-generator && brew install --HEAD openapi-generator` @@ -290,7 +290,7 @@ Example: ```sh docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ + -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -g go \ -o /local/out/go ``` @@ -315,7 +315,7 @@ GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request to generate a Ruby client > curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' \ --d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml"}' \ +-d '{"openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml"}' \ 'http://localhost:8888/api/gen/clients/ruby' {"code":"c2d483.3.4672-40e9-91df-b9ffd18d22b8","link":"http://localhost:8888/api/gen/download/c2d483.3.4672-40e9-91df-b9ffd18d22b8"} @@ -351,7 +351,7 @@ Once built, `run-in-docker.sh` will act as an executable for openapi-generator-c ./run-in-docker.sh help # Executes 'help' command for openapi-generator-cli ./run-in-docker.sh list # Executes 'list' command for openapi-generator-cli ./run-in-docker.sh /gen/bin/go-petstore.sh # Builds the Go client -./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ +./run-in-docker.sh generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -g go -o /gen/out/go-petstore --package-name=petstore # generates go client, outputs locally to ./out/go-petstore ``` @@ -389,16 +389,10 @@ Install it globally to get the CLI available on the command line: ```sh npm install @openapitools/openapi-generator-cli -g -openapi-generator version +openapi-generator-cli version ``` -Or install a particular OpenAPI Generator version (e.g. v5.0.0-beta2): - -```sh -npm install @openapitools/openapi-generator-cli@cli-5.0.0-beta2 -g -``` - Or install it as dev-dependency: ```sh @@ -407,17 +401,17 @@ npm install @openapitools/openapi-generator-cli -D ## [2 - Getting Started](#table-of-contents) -To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml), please run the following +To generate a PHP client for [petstore.yaml](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml), please run the following ```sh git clone https://github.com/openapitools/openapi-generator cd openapi-generator mvn clean package java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ + -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -g php \ -o /var/tmp/php_api_client ``` -(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php -o c:\temp\php_api_client`) +(if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`) You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.0.0-beta2/openapi-generator-cli-5.0.0-beta2.jar) @@ -430,7 +424,7 @@ To get a list of PHP specified options (which can be passed to the generator wit ## [3 - Usage](#table-of-contents) ### To generate a sample client library -You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml) as follows: +You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml) as follows: ```sh ./bin/java-petstore-okhttp-gson.sh @@ -442,7 +436,7 @@ This script uses the default library, which is `okhttp-gson`. It will run the ge ```sh java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate \ - -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \ + -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml \ -g java \ -o samples/client/petstore/java/okhttp-gson ```