Repository navigation
Conversation
Regenerates the OpenAPI spec, fetches swagger-ui-dist via npm, and drops a same-origin Swagger UI page into a running `./gradlew dev` instance so you can "Try it out" against a real local Solr without writing client code. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
Adds a static Swagger UI page at /solr/libs/swagger-ui/, built from the same
OpenAPI spec that feeds the generated SolrJ clients:
- :solr:webapp now consumes :solr:api's openapiSpec artifact and bakes it
into the war as spec.json, so it ships in sync with the running version.
- ApiMetadata now declares a relative `servers: [{url: "/api"}]` entry so
"Try it out" calls stay same-origin with whichever node serves the page,
with no CORS setup needed.
- swagger-ui-dist's bundle/preset/css are vendored under web/libs/swagger-ui/,
attributed in NOTICE.txt alongside the project's other bundled JS libraries.
- The init call lives in its own openapi-init.js rather than an inline
<script>, since Solr's CSP header (script-src 'self', no 'unsafe-inline')
silently drops inline scripts.
- Linked from the Admin UI's footer nav (opens in a new tab, parallel to
the Admin UI rather than embedded in its routing).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
./gradlew :solr:webapp:rat failed on the API Explorer files added in the previous commit: - index.html and openapi-init.js are first-party; they were missing the standard ASF header. - swagger-ui-bundle.js, swagger-ui-standalone-preset.js, swagger-ui.css, and index.css are vendored from swagger-ui-dist unmodified. Webpack strips their own and their bundled dependencies' license text out into sibling *.LICENSE.txt files rather than leaving a recognizable header in the minified output, so RAT can't classify them - excluded by path instead, following the precedent set by :solr:server's vendored Jetty config files. Also vendors the two *.LICENSE.txt files themselves (already covered by the blanket "**/*.txt" RAT exclude), since they document the MIT/Apache-licensed third-party code swagger-ui-dist itself bundles. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RzzUgiebQ8ZhhgE2E7ZZU5
|
Draft Review:
AI-generated. Details available upon request. |
|
I started with Swagger UI, but it was just kind of clunky and old feeling. I found this compatible UI Scalar. Turns out this space has a bunch of new tools like this, all comepting to be your next mcp/llms.txt/etc generating tool! Since this is lightly integrated (just a link from our footer in the admin tool) I htink if it goes dormant, we can eliminate it in a few years pretty easily! |
|
@jaykay12 you may be itnerested in this! |
|
I'm sceptical to vendor-owned open source like this, you never know how long it is truly open, whether their product phones home etc. But if we screen for such things it should not be risky to include. I'd prefer if the UI is just always available on a solr node. |
Yeah... All of them feel like "a burst of amazing, and then they die off". One of the last generation of these, maybe redoc or redocly now points to a casino website ;-(. I believe this is pretty isolated impact, so we can use it and toss it if needed. Good question on the phone home, I'll look. |
|
So, @gerlowskija noticed that the |
|
Scalar is "having a moment" (not that should be why we use it), but I've seen it behind two other websites recently.. ;-) |
|
Yes, I'd prefer it ships as a standard feature of Admin UI. Or alternatively its own servlet next to /solr, but always available. |
|
Okay... @gerlowskija I moved it to being built via our build tooling, no more GIANT file. @janhoy it's now a standalone html app, but integrated more closely! |
|
Maybe nice to haves?
|
|
What's the state of this PR @epugh ? Is it something you're looking to merge soon, or is truly just a demo as the title/description suggest and not quite ready for committing yet? |
|
Okay, I'm going to call this "done" for now and ready for review. Lots of cool ideas of where we can go, but hoenstly, jstu getting this in will be awesome. |

Description
Expose Scalar OpenAPI Explorer ui in our webapp for the V2 APIs.
Solution
Scalar is opensource librarby that we have intergrated in a fairly "minimal" fashiong. We leverage the Node tooling so we download the scalar libs at build time, but the whole app lives outside of our Solr Admin UI, in a parralle directory. This was for seperation, but also because our Angular App and the SPA of Scalar fight if they are in the same window. Scalar is embedded as an iframe.
It comumes the current openapi spec.
Tests
manual + a new selenium test.