SIGN IN SIGN UP

ci: Sort generated model classes alphabetically with topological ordering (#727)

## Summary

- Add alphabetical class sorting (with topological ordering to respect
inheritance) to `postprocess_generated_models.py`, so that regeneration
from a reordered OpenAPI spec produces minimal diffs.
- Make `add_docs_group_decorators` idempotent so the script can be
safely re-run.
- Apply the new sorting to `_models.py`.

## Note

- This is a workaround until
[datamodel-code-generator#3087](https://github.com/koxudaxi/datamodel-code-generator/issues/3087)
is implemented (if ever).

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
V
Vlada Dusek committed
586d15e2904030c53996b66d5c3a63cf94fcd124
Parent: d52bc8d
Committed by GitHub <noreply@github.com> on 4/15/2026, 12:06:39 PM