Render OpenAPI request/response examples from per-property examples#18629
Render OpenAPI request/response examples from per-property examples#18629
Conversation
ReviewTemplate-only change — no doc content to style-check. Scope: correctness, maintainability, and behavioral changes in the four The refactor is coherent, well-commented, and the Concerns1. The walker handles 2. This assumes every 3. Previously 4. For a non-GET operation with no …so you get a POST/PUT/DELETE that declares a JSON content type with no 5. The two branches duplicate the 6.
Non-blocking nits
Draft statusPR description already notes this lands as a no-op until upstream Java annotations populate Mention @claude if you'd like another pass after changes. |
|
Your site preview for commit e9c2532 is ready! 🎉 http://www-testing-pulumi-docs-origin-pr-18629-e9c25328.s3-website.us-west-2.amazonaws.com |
Lighthouse Performance ReportCommit: e9c2532 | Metric definitions
|
Reintroduces cURL request bodies and example response JSON on the generated REST API pages. Reads route-level examples from the native OpenAPI 3 mediaType.example slot, which the upstream service spec now populates via @PulumiRouteProperty(requestExample / responseExample) text blocks (see pulumi/pulumi-service#41680). No Hugo-side synthesis: the authoritative example shape lives in the spec, rendered as-is. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31d3041 to
e9c2532
Compare
Summary
Reintroduces cURL request bodies and example response JSON on the generated REST API pages, previously removed in #18551.
Reads route-level examples from the native OpenAPI 3
mediaType.exampleslot : no Hugo-side synthesis, no traversal of schema property trees. The upstream service spec populates that slot via@PulumiRouteProperty(requestExample = """...""", responseExample = """...""")text blocks (pulumi/pulumi-service#41680). Whatever shows up in the spec is what renders.What this changes
layouts/partials/openapi/endpoint.html: uncomments thetemplate "openapi/request-example.html"andtemplate "openapi/examples.html"call sites that were disabled in Generate REST API docs from live OpenAPI spec #18551.layouts/partials/openapi/request-example.html: renders a cURL block with--data '...'when the operation'sapplication/jsonrequest body has anexample; otherwise renders the cURL without a body.layouts/partials/openapi/examples.html: rendersapplication/jsonresponseexample(or iteratesexamplesif plural is used) as pretty JSON.Total: one file deleted (the prior-draft synthesizer), three edited.
Not in this PR
Draft
Held as draft until the service-side PR (pulumi/pulumi-service#41680) lands and the public spec starts carrying route-level examples. Once that ships, this PR becomes a mechanical "turn it on" merge.
🤖 Generated with Claude Code