[README] Usage instructions do not work - README is out-of-date
Created by: intelliot
Description
currently says:
The READMEYou can build a client against the Petstore API as follows:
./bin/java-petstore.sh
(On Windows, run .\bin\windows\java-petstore.bat
instead)
openapi-generator version
master (fe0f2cfa)
OpenAPI declaration file content or url
N/A
Command line used for generation
The file is missing.
./bin/java-petstore.sh
no such file or directory: ./bin/java-petstore.sh
Steps to reproduce
Follow the Usage instructions in the README.
./bin/java-petstore.sh
Related issues/PRs
None found.
Suggest a fix/enhancement
I'm happy to fix these instructions and open a PR, but I am new to this project and am not sure what the correct fix would be. Is ./bin/java-petstore-all.sh
the new script to use?
If so, is the following information (copied from the README) still accurate? See below:
This will run the generator with this command:
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 java \
-o samples/client/petstore/java
with a number of options. You can get the options with the help generate
command (below only shows partial results):
NAME
openapi-generator-cli generate - Generate code with the specified
generator.
SYNOPSIS
openapi-generator-cli generate
[(-a <authorization> | --auth <authorization>)]
[--additional-properties <additional properties>...]
[--api-package <api package>] [--artifact-id <artifact id>]
[--artifact-version <artifact version>]
[(-c <configuration file> | --config <configuration file>)]
[-D <system properties>...]
[(-g <generator name> | --generator-name <generator name>)]
[--git-repo-id <git repo id>] [--git-user-id <git user id>]
[--group-id <group id>] [--http-user-agent <http user agent>]
(-i <spec file> | --input-spec <spec file>)
[--ignore-file-override <ignore file override location>]
[--import-mappings <import mappings>...]
[--instantiation-types <instantiation types>...]
[--invoker-package <invoker package>]
[(-l <language> | --lang <language>)]
[--language-specific-primitives <language specific primitives>...]
[--library <library>] [--log-to-stderr]
[--model-name-prefix <model name prefix>]
[--model-name-suffix <model name suffix>]
[--model-package <model package>]
[(-o <output directory> | --output <output directory>)]
[--release-note <release note>] [--remove-operation-id-prefix]
[--reserved-words-mappings <reserved word mappings>...]
[(-s | --skip-overwrite)] [--skip-validate-spec]
[(-t <template directory> | --template-dir <template directory>)]
[--type-mappings <type mappings>...] [(-v | --verbose)]
OPTIONS
-a <authorization>, --auth <authorization>
adds authorization headers when fetching the OpenAPI definitions
remotely. Pass in a URL-encoded string of name:header with a comma
separating multiple values
...... (results omitted)
-v, --verbose
verbose mode
You can then compile and run the client, as well as unit tests against it:
cd samples/client/petstore/java
mvn package
Other languages have petstore samples, too:
./bin/android-petstore.sh
./bin/java-petstore.sh
./bin/objc-petstore.sh