I am generating client code for my API using the following commands:
# generate openapi-schema yml file using bazel and spectacular
bazel run //projects/api:manage spectacular -- --fail-on-warn --file $OUTPUT_DIR/openapi-schema.yml
# use that file to generate full api client code, including README.md file
npx @openapitools/openapi-generator-cli generate -g python -o $OUTPUT_DIR -i $OUTPUT_DIR/openapi-schema.yml --package-name=app.api
Doing this generates a nice README.md
file that covers basic usage of the API.
However this readme lacks some specific information that I need in my project README. If I add it manually, it will just get overwritten next time I run the openapi generation script.
So I would like to modify this README automatically as part of the generation. This may involve removing entire sections and adding some that are custom written and unlikely to change between API iterations (covering, for example, some of the specific permission settings that need to be set to make any of the API work how to do that).
How can I customize this auto generated README? Is the only way to generate the file as is, and then have another command edit the file? I would prefer a cleaner solution if possible.
Thanks!