DOC-13663: Improve process for Search and Query REST API examples#207
Merged
simon-dew merged 30 commits intorelease/7.6from Feb 4, 2026
Merged
DOC-13663: Improve process for Search and Query REST API examples#207simon-dew merged 30 commits intorelease/7.6from
simon-dew merged 30 commits intorelease/7.6from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves the process for generating REST API documentation by bundling examples directly from OpenAPI specifications using the Redocly CLI, eliminating the need to fetch and maintain separate example files in the repository.
Changes:
- Replaced example file fetching tasks with Redocly bundling tasks in Gradle build files
- Updated Handlebars templates to automatically generate examples from bundled specifications
- Removed obsolete example files and partials that are now generated automatically
Reviewed changes
Copilot reviewed 161 out of 239 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| templates/*.handlebars | New templates for rendering request/response examples from spec data |
| templates/index.handlebars | Enhanced to generate examples automatically and support curl-request snippets |
| templates/param.handlebars | Added fallback to description field |
| docs/modules/*/*.gradle | Replaced getExamples tasks with bundleSpec tasks using Redocly CLI |
| docs/modules/*/partials/header-attributes.adoc | Added :!example-caption: attribute |
| docs/modules//partials/paths/*/http-.adoc | Removed or simplified partials now handled by templates |
| docs/modules/*/pages/index.adoc | Regenerated with embedded examples from specs |
| docs/modules/*/examples/*.json, *.sh | Removed example files now bundled from upstream |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
simon-dew
added a commit
that referenced
this pull request
Feb 4, 2026
* Bundle Query and FTS specs using Redocly * Build inline curl request, http request, and http response examples using handlebars templates * Remove unnecessary local examples * Remove unnecessary example partials * Update remaining example partials — they're just explanations now * Rename all existing http-request partials to curl-request * Add ID to examples * Fix xref in example partial * Remove example captions from Query API docs * Output default for response code 0 * Build output documentation
simon-dew
added a commit
that referenced
this pull request
Feb 4, 2026
* Bundle Query and FTS specs using Redocly * Build inline curl request, http request, and http response examples using handlebars templates * Remove unnecessary local examples * Remove unnecessary example partials * Update remaining example partials — they're just explanations now * Rename all existing http-request partials to curl-request * Add ID to examples * Fix xref in example partial * Remove example captions from Query API docs * Output default for response code 0 * Build output documentation
simon-dew
added a commit
that referenced
this pull request
Feb 4, 2026
* Bundle Query and FTS specs using Redocly * Build inline curl request, http request, and http response examples using handlebars templates * Remove unnecessary local examples * Remove unnecessary example partials * Update remaining example partials — they're just explanations now * Rename all existing http-request partials to curl-request * Add ID to examples * Fix xref in example partial * Remove example captions from Query API docs * Output default for response code 0 * Build output documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira issue: DOC-13663
This PR revisits requirement 2 of the Jira ticket, "Make sure the static REST API references get their examples from the dev repos". Now that we have migrated to Handlebars, it is possible to bundle the examples into the spec using the Redocly CLI, and then build the examples into the generated AsciiDoc automatically. This enables us to get rid of many superfluous example files that were being copied to this repo, and the partials which included those example files.
As part of this I have also updated the templates to look for
curl-request.adocpartials in the{snippetDir}, in addition tohttp-request.adocandhttp-response.adocpartials.curl-request.adocpartials are now used for command line request examples using curl.http-request.adocpartials are now used for request body examples.http-response.adocpartials are still used for response body examples.I chose these partials for compatibility with the Spring REST Docs snippets expected by Swagger2Markup, even though they are not strictly in line with the Default Snippets generated by Spring REST Docs.
I have tweaked the functionality of these snippets so that if examples are present in the spec, the snippet text is included after the automatically-generated example title, but before the example itself. This enables you to use the snippets (without header) to add a commentary or extra information to the example. If there is no example present in the spec, you can use the snippet to add an entire example (with header) as previously.
There are still some example files and partials remaining in this repo for the Query REST APIs. That's because we need to further refine the spec upstream to include shell script and / or body text examples. See DOC-13976.