Repository navigation
docs: explain OpenAPI integer bounds generation - #1721
jeeeeetshahhhhh wants to merge 3 commits into
Conversation
|
hi @jeeeeetshahhhhh i am not sure if a new config or makefile command is required given that this is already a defined step in pre-commit steps anyone interested can just use this command manually as well pokeapi/.pre-commit-config.yaml Line 55 in 8a92bfa in fact this dosent require docker running or a local postgres the config only serves the purpose of telling django spectacular whats the backend db like and based on that it decides the int bounds from the db int type no actual query to db is made what i could see however is we can make a note of this behavior somewhere in contributing |
|
Thanks for clarifying. I removed the extra settings module and Make target, and moved the change to CONTRIBUTING.md. It now documents the existing manual |
| This command does not need a running database: the configured database backend determines integer bounds in the | ||
| schema, and schema generation does not query the database. | ||
|
|
||
| > [!NOTE] |
There was a problem hiding this comment.
looks like i missed removing this note when i enabled ty and ruff, can you update this note and move the above info into this note mentioning "if in case there are model or schema changes folks can simply run the pre-commit to regenerate the openapi spec" just a single line should be enough
you can also maybe add an additional mention that running the pre-commit locally before raising a pr ensures the ci passes with no unexpected failures
|
Addressed in 78d62e6. I moved the database-backend/schema-generation explanation into the existing CONTRIBUTING note, removed the duplicate manual command instructions, and added the requested guidance to run pre-commit after model/schema changes and locally before opening a PR. |
Summary
generate-openapipre-commit commandAddresses #1623 by explaining why SQLite and PostgreSQL can produce different integer bounds and how to regenerate the schema consistently.
Validation
git diff --check