diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index ba53fc02d04..5d331325628 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -14,5 +14,5 @@ Commit all changed files. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. - You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/python*`. + You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/generate_samples_configs/python*` For Windows users, please run the script in [Git BASH](https://gitforwindows.org/). diff --git a/README.md b/README.md index 11a66b59a46..25d8189da08 100644 --- a/README.md +++ b/README.md @@ -272,7 +272,7 @@ To get a list of PHP specified options (which can be passed to the generator wit You can build a client against the [Petstore API](https://raw.githubusercontent.com/openapijsonschematools/openapi-json-schema-generator/master/src/test/resources/3_0/petstore.yaml) as follows: ```sh -./bin/generate-samples.sh ./bin/configs/python.yaml +./bin/generate-samples.sh ./bin/generate_samples_configs/python.yaml ``` (On Windows, please install [GIT Bash for Windows](https://gitforwindows.org/) to run the command above) diff --git a/docs/contributing.md b/docs/contributing.md index 19f059821d8..019ee7f195e 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -92,7 +92,7 @@ To add test cases (optional) covering the change in the code generator, please r To test the templates, please perform the following: -- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion) +- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh ./bin/generate_samples_configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapi-json-schema-tools/openapi-json-schema-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion) - During development, it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`. - Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests). __Please notice:__ you must run a local instance of the Petstore server in order to perform the tests, as running them against petstore.swagger.io is not supported anymore. Please refer to item 3 of [Integration Tests - How to add integration tests for new Petstore samples](https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests#how-to-add-integration-tests-for-new-petstore-samples) to learn how to quickly configure and run it. - Finally, git commit the updated samples files: `git commit -a` (`git add -A` if added files with new test cases) diff --git a/samples/client/petstore/python/test_python.sh b/samples/client/petstore/python/test_python.sh index 1d6b423af13..707576658b5 100755 --- a/samples/client/petstore/python/test_python.sh +++ b/samples/client/petstore/python/test_python.sh @@ -21,7 +21,7 @@ python -m pip install . # run tests tox || exit 1 -pip install mypy +pip install mypy==1.8.0 # run mypy, static type checking mypy src/petstore_api