Skip to content

Render OpenAPI spec as Ref Guide page - #4291

Closed
epugh wants to merge 5 commits into
apache:mainfrom
epugh:SOLR-17395-elements-ui
Closed

epugh wants to merge 5 commits into
apache:mainfrom
epugh:SOLR-17395-elements-ui

Conversation

@epugh

@epugh epugh commented Apr 19, 2026 •

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/SOLR-17395

Description

POC of using the https://stoplight.io/open-source/elements library to render our OpenAPI specfication in Ref Guide.

Solution

This is just a draft, and I don't even know if it should be in Ref Guide or standalone site? I tried Redoc which I've used before but couldn't get the magic to work.

After building the site you need to run python3 -m http.server 8080 --directory solr/solr-ref-guide/build/site and hit port 8080.. The docs only work in a HTTP environment.

Tests

manual

./gradlew clean
./gradlew :solr:solr-ref-guide:buildLocalSite
python3 -m http.server 8080 --directory solr/solr-ref-guide/build/site

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Dependency upgrades tool:build labels Apr 19, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This whole toplevel nav coupld be moved under somewhere else if we wanted..

@epugh

epugh commented Apr 19, 2026

Copy link
Copy Markdown
Contributor Author

Example of UI rendered:
image

@epugh
epugh requested review from gerlowskija and janhoy April 19, 2026 01:03
@epugh
epugh marked this pull request as ready for review April 19, 2026 01:03
@solrbot

solrbot commented Apr 19, 2026

Copy link
Copy Markdown
Collaborator

Cool

@janhoy

janhoy commented May 20, 2026

Copy link
Copy Markdown
Contributor

I wonder if a better fit than ref-guide is to add it as part of or alongside the Admin UI on /api-docs/ or something?

@epugh

epugh commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

I wonder if a better fit than ref-guide is to add it as part of or alongside the Admin UI on /api-docs/ or something?

Are you suggesting having it not as static docs but as an actual deployed artifacts? Kind of like how https://go.quepidapp.com/api/docs works?

@janhoy

janhoy commented May 20, 2026

Copy link
Copy Markdown
Contributor

Yes, that would be great. I’m not saying it won’t be useful as static pages in ref guide too, but perhaps then using a more doc like, less interactive rendering?

@gerlowskija

Copy link
Copy Markdown
Contributor

I wonder if a better fit than ref-guide is to add it as part of or alongside the Admin UI on /api-docs/ or something?

My original intention for this JIRA was more to generate a bunch of small snippets using openapi-generator that would then be referenced on individual sections of our ref-guide (via the include:: syntax that lets you bring in content from other files).

IMO that's still the best option as it'd allow us to reduce what we're currently maintaining "by hand". But there's still lots of value in a parallel /api-docs/ endpoint that exposes a Redocly/Swagger site totally separate from the ref-guide. Either of those approaches would be a "Good Thing" IMO.

@janhoy

janhoy commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

My original intention for this JIRA was more to generate a bunch of small snippets using openapi-generator that would then be referenced on individual sections of our ref-guide (via the include:: syntax that lets you bring in content from other files).

That makes sense. Would those snippets be individual files checked into git, with explicit re-generation (like we have for picocli docs in a pr branch)? I imagine an on-demand build of openapi-spec is too heavy. Where do we currenlty hand-code REST-API paths, actions and parameters? I know we have some cURL examples here and there, those would be hard to replace as is. Guess an example would help here to grok what it would look like.

To limit scope, this PR should probably only do the rendering of these static snippets and wire it in one place in the ref-guide. Then follow-up PRs can replace more hand-written docs. And yet another PR could add swagger-UI style live docs.

@janhoy

janhoy commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Next step on this?

@github-actions

Copy link
Copy Markdown

This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the dev@solr.apache.org mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution!

@github-actions github-actions Bot added the stale PR not updated in 60 days label Sep 30, 2026
@epugh

epugh commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

closing in favour of the interactive api explorer in #5201

@epugh epugh closed this Oct 28, 2026
@gerlowskija

Copy link
Copy Markdown
Contributor

I'm +1 to close this out in its current form.

That said - I do think we'll need to think through the implications for the ref-guide as v2 takes over more and more. DRY applies to documentation just as much as code, so we don't want to repeat (e.g.) parameter descriptions in multiple places. The API Explorer approach is probably easier in some ways, nut I think the ref-guide's current format is a richer, better experience for most users...

@epugh

epugh commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

I suspect figuring this out will be driven by when we decide we can remove V1 from our Ref Guide, becasue at that point, we won't have to be straddleing the "v1 and v2" examples that we currently have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Dependency upgrades documentation Improvements or additions to documentation stale PR not updated in 60 days tool:build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants