Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit fb9b48f

Browse files
authored
Fixes generate_samples invocations (#407)
* Fixes invocation * pegs mypy to v1.8.0 to prevent test failure
1 parent 5da69d9 commit fb9b48f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
Commit all changed files.
1515
This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master.
1616
These must match the expectations made by your contribution.
17-
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*`.
17+
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*`
1818
For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ To get a list of PHP specified options (which can be passed to the generator wit
272272
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:
273273

274274
```sh
275-
./bin/generate-samples.sh ./bin/configs/python.yaml
275+
./bin/generate-samples.sh ./bin/generate_samples_configs/python.yaml
276276
```
277277

278278
(On Windows, please install [GIT Bash for Windows](https://gitforwindows.org/) to run the command above)

docs/contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ To add test cases (optional) covering the change in the code generator, please r
9292

9393
To test the templates, please perform the following:
9494

95-
- 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)
95+
- 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)
9696
- 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`.
9797
- 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.
9898
- Finally, git commit the updated samples files: `git commit -a` (`git add -A` if added files with new test cases)

samples/client/petstore/python/test_python.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ python -m pip install .
2121

2222
# run tests
2323
tox || exit 1
24-
pip install mypy
24+
pip install mypy==1.8.0
2525
# run mypy, static type checking
2626
mypy src/petstore_api
2727

0 commit comments

Comments
 (0)