Repository navigation
feat: read the API docs of the endpoint and keep them by their ETag - #113
Merged
Merged
Conversation
|
Coverage of the acceptance run against the meshStack backend, on
Uncovered functions
|
api and api-docs download the API docs from /api/openapi of the endpoint, which needs no login, and keep them in the config directory under api-docs/, with one index per endpoint. A later command asks with If-None-Match and reads the kept document on a 304. Without an endpoint, the commands use the published API docs; with a warning, also where the endpoint has none, or cannot be reached and none of its docs are kept. MESHSTACK_API_DOCS_URL is gone. client/openapi reads what the served docs use: an allOf of one schema, maps, oneOf and anyOf, and x-meshstack-path-key-by-version. Only the 2xx responses give the media types of an operation, because an error response carries application/json whatever the operation serves. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
grubmeshi
force-pushed
the
apidocs-etag
branch
from
November 25, 2026 12:22
72e7097 to
3d91f79
Compare
|
j0g3sc
approved these changes
Nov 25, 2026
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.



What it does
meshstack apiandmeshstack api-docsdownload the API docs from/api/openapiof the endpoint, which needs no login. They keep them in the config directory underapi-docs/, with one index file per endpoint, and ask again withIf-None-Match. On a 304 they read the kept document.--devand a build of no release use the docs of develop.MESHSTACK_API_DOCS_URLis gone. The fake meshStack serves the docs with an ETag.client/openapireads what the served docs use: anallOfof one schema, maps (additionalProperties),oneOfandanyOf, andx-meshstack-path-key-by-version. Only 2xx responses give the media types of an operation, because an error response always carriesapplication/json.Selectnarrows each operation by itself.Review carefully
internal/apidocs/apidocs.goandstore.go(fallbacks, index per endpoint, writes),client/openapi/doc.goandspec.go.Mechanical
The test fixture
client/openapi/testdata/spec.jsonand the expected outputs incmd/api/api_test.go.Place in the stack
4 of 6. Base:
http-do-request. Next:generic-mesh-object-client.🤖 Generated with Claude Code