Skip to content

pystapi-schema-generator, take 2 - #130

Open
jkeifer wants to merge 1 commit into
jak/stapi-v0.2.0from
jak/pystapi-schema-generator
Open

pystapi-schema-generator, take 2#130
jkeifer wants to merge 1 commit into
jak/stapi-v0.2.0from
jak/pystapi-schema-generator

Conversation

@jkeifer

@jkeifer jkeifer commented Aug 7, 2026

Copy link
Copy Markdown
Member

What I'm changing

  • Adds a new component, pystapi-schema-generator, to generate a somewhat-normative openapi.yml spec doc via a specially-formulated stapi-fastapi implementation.

How I did it

  • Built a new project out in the pattern of that in feat: add pystapi-schema-generator #68, but instead of reimplementing the routers and whatnot, this version just sets up the app and then post-processes the resulting openapi.yml.

This was rather vibed via Claude Opus 5. I have not reviewed thoroughly, but the result seems "okay". Due to challenges with fastapi idiosyncracies and the reality of pydantic modeling, the result is not really good enough to be used in the stapi-spec repo. I honestly don't know if we would want to keep this, but I figured it I should push it because I had it working.

Checklist

  • Tests pass: ./scripts/run-tests.sh
  • Checks pass: uv run pre-commit run --all-files
  • CHANGELOG is updated (if necessary)

The conformance gate needs an OpenAPI document to validate against, and until
now there was nothing that produced one except the test application, whose
document describes the fixtures rather than the API generically.

`pystapi-schema-generator` builds a reference application out of the routers
and exports its document. It lives outside `tests/`, so what it publishes is
the API's own shape rather than a particular test's, and it templatizes the
product paths to `{productId}` so a multi-product deployment is described
once rather than per fixture.

Kept as the last commit on the branch and touching nothing before it: the
package, the workspace member and source entries, its place in the mypy and
test loops, and the lockfile. It can be lifted off onto its own branch
without disturbing the stapi-pydantic and stapi-fastapi releases.
@jkeifer jkeifer mentioned this pull request Aug 7, 2026
4 tasks
@jkeifer
jkeifer changed the base branch from main to jak/stapi-v0.2.0 August 7, 2026 03:49
@jkeifer jkeifer changed the title Jak/pystapi schema generator pystapi-schema-generator, take 2 Aug 7, 2026
@jkeifer
jkeifer marked this pull request as ready for review August 7, 2026 03:50
@jkeifer
jkeifer requested a review from gadomski as a code owner August 7, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant