Skip to content

docs(readme): point the validation callout at the single-declaration path - #866

Merged
yeongseon merged 3 commits into
mainfrom
docs/readme-validation-callout
Oct 30, 2026
Merged

yeongseon merged 3 commits into
mainfrom
docs/readme-validation-callout

Conversation

@yeongseon

@yeongseon yeongseon commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

The README validation callout suggests layering @validate_http on the same models next to @openapi, which reads as declaring every model twice. This adds the missing signpost for the single-declaration option.

Changes

  • README.md: one sentence appended to the existing callout. It says that @validate_http alone is enough for the generated spec and links to the usage guide. The callout stays one paragraph and the recommended pairing is unchanged.
  • docs/usage.md: the "Automatic bridge (zero-duplication)" section now says that register_openapi_routes(app, ...) and the app= argument of the generators already scan the app, so a separate scan_endpoint_metadata(app) call is optional, and when a direct call is still useful.

Validation

Run locally:

  • mkdocs build --strict: exit 0 with no new warnings. The automatic-bridge-zero-duplication anchor exists in the built page.
  • Checked the claim in the new sentence: with only @validate_http(body=..., query=..., response_model=..., status_code=201), generate_openapi_spec(app=app) produces the request body, the flattened query parameters, the 201 response and the 422 response.

GitHub CI on 629de9d: all check runs completed with no failures, including the required Analyze, bandit, ci-required, PR title and semgrep contexts.

Related Issues

Closes #862

yeongseon and others added 2 commits October 30, 2026 19:34
…path

The callout suggests layering @validate_http on the same models next to @openapi, which reads as declaring every model twice. Add one sentence saying @validate_http alone is enough for the spec, with a link to the usage guide. Refs #862

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>
…the app

The zero-duplication section tells readers to call scan_endpoint_metadata(app), although register_openapi_routes and the app= argument of the generators already scan the app. Say so and describe when a direct call is still useful. Refs #862

Co-authored-by: sisyphus-dev-ai <sisyphus-dev-ai@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues require changes.

No open issues 🎉

What changed in this PR

Clarifies the single-declaration validation path, addressing #862 without changing runtime behavior or the recommended decorator pairing.

Changes:

  • Adds a README signpost explaining that @validate_http metadata can generate the spec without repeating models in @openapi.
  • Clarifies that route registration and generators using app= scan metadata automatically, and explains when an explicit scan is useful.
File Description
README.md Links the validation callout to the single-declaration usage guide.
docs/​usage.md Explains automatic metadata scanning and optional explicit scans.

Review effort: Balanced

@yeongseon
yeongseon merged commit 2a4652a into main Oct 30, 2026
22 checks passed
@yeongseon
yeongseon deleted the docs/readme-validation-callout branch October 30, 2026 14:02
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.

docs(readme): link the validation callout to the single-declaration @validate_http path

2 participants