-
Notifications
You must be signed in to change notification settings - Fork 21
Home
Daniel Metzner edited this page Jan 17, 2021
·
5 revisions
Yes, the creators of this repository are aware that name selection is not their strong suit!
The catroweb.yaml
file contains the Open API documentation for our API. If you need to change anything about our API, be it new routes, or updating old ones, do it there. We are currently working on securing a Swagger Hub license to do a push feature to this repository.
- Delete all old auto-generated files to prevent unused files from existing
run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v5.0.0-beta generate -i local/catroweb.yaml -g php-symfony -p sortParamsByRequiredFlag=true -p skipFormModel=true -p variableNamingConvention=snake_case -p phpLegacySupport=false -o /local
- Generate the code (based on catroweb.yml, might need to download the jar file first!)
java -jar ../openapi-generator-cli.jar generate \
-i catroweb.yaml \
-g php-symfony \
-p sortParamsByRequiredFlag=true \
-p skipFormModel=true \
-p variableNamingConvention=snake_case \
-p phpLegacySupport=false && vendor/bin/php-cs-fixer fix --allow-risky=yes --verbose --format=txt
- Or with docker (On windows use powershell):
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli:v5.0.0-beta generate -i local/catroweb.yaml -g php-symfony -p sortParamsByRequiredFlag=true -p skipFormModel=true -p variableNamingConvention=snake_case -p phpLegacySupport=false -o /local
- Additionally, you should run the code style fixer
docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:latest --allow-risky=yes --verbose --format=txt
- Create a new branch, commit, push and create the Pull Request
We have a workflow to do all this for you automatically.
- On Github, go to the Actions tab
- Click on "Code Generation Pull Request" workflow
- Click on "Run workflow"
- Choose branch (develop)
- Run the workflow and enjoy the auto-generated code/PR