Skip to content

fix(spec): add a concrete server URL so request examples render - #362

Merged
jackye1995 merged 2 commits into
lance-format:mainfrom
jackye1995:jack/fix-openapi-request-examples
Aug 30, 2026
Merged

jackye1995 merged 2 commits into
lance-format:mainfrom
jackye1995:jack/fix-openapi-request-examples

Conversation

@jackye1995

Copy link
Copy Markdown
Collaborator

Every entry in servers is templated ({scheme}://{host}:{port}/{basePath}). Documentation renderers and API consoles substitute no variables in that case, so they cannot construct a request URL and print an error where each endpoint's code samples belong.

On docs.lancedb.com this currently leaves 43–48 of the 55 REST reference pages showing "A valid request URL is required to generate request examples" instead of cURL/Python/JavaScript samples. Which pages fail varies between builds, and the pages that do render emit the unsubstituted template as the request URL:

curl --request GET --url {scheme}://{host}:{port}/{basePath}/v1/table

Adding a concrete server ahead of the templated ones resolves it. Verified end to end by building the docs site against the patched spec: all 55 endpoint pages render examples, with real URLs (http://localhost:2333/v1/table).

The templated entries are kept, so a configurable base URL remains available. http://localhost:2333 matches what the first templated server already resolves to from its own defaults, so the effective default is unchanged apart from dropping a trailing slash that produced //v1/... in generated paths.

make lint (openapi-spec-validator --errors all) passes.

Every entry in `servers` was templated. Documentation renderers and API
consoles substitute no variables in that case, so they cannot construct a
request URL and print an error where each endpoint's code samples belong.

On docs.lancedb.com this leaves 43-48 of the 55 REST reference pages showing
"A valid request URL is required to generate request examples" instead of
cURL/Python/JavaScript samples, and which pages fail varies between builds.
The pages that do render emit the unsubstituted template as the URL.

Adding a concrete server ahead of the templated ones fixes all 55. The
templated entries stay, so a configurable base URL is still available.
@github-actions github-actions Bot added the bug Something isn't working label Aug 30, 2026
@github-actions github-actions Bot added python Python features java Java features labels Aug 30, 2026
@jackye1995
jackye1995 merged commit 3b167e4 into lance-format:main Aug 30, 2026
5 checks passed
@jackye1995
jackye1995 deleted the jack/fix-openapi-request-examples branch August 30, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working java Java features python Python features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant