Add jf api docs describe for OpenAPI operation detail lookup - #3630
Open
ehl-jf wants to merge 2 commits into
Open
Add jf api docs describe for OpenAPI operation detail lookup#3630ehl-jf wants to merge 2 commits into
ehl-jf wants to merge 2 commits into
Conversation
Adds "jf api docs describe <METHOD> <path>" as a sibling of "jf api docs search", returning the full trimmed view of a single operation from the embedded OpenAPI spec bundle: parameters, request body schema (with an example payload when the spec declares one), response codes/descriptions, and a ready-to-run "jf api" one-liner. JSON is the unconditional default output format, matching docs search's established convention. Extends the apispec parser with response parsing and request-body example capture, plus a FindOperation exact-match lookup helper. Not-found is a hard error (unlike search's 0-exit empty result), pointing back to docs search. Updates jf api --ai-help and related help text to complete the search -> describe -> execute discovery chain and drops the stale "OpenAPI bundles are not shipped" claim.
Checks the "required" type assertion instead of asserting it inline (forcetypeassert), and drops runDescribeJSON's unused "logged" return value (unparam) -- no test consumed it.
Contributor
vitaliil-jfrog
approved these changes
Jul 29, 2026
christophermiJfrog
approved these changes
Jul 30, 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.

jf api docs describe— full operation detail lookupFollow-up to
jf api docs search(#3597 / JGC-526). Search finds a candidate endpoint bykeyword; this PR adds a second
jf api docssubcommand to see that endpoint's full shapebefore calling it — parameters, request body schema, response codes, and (when the spec
declares one) an example payload — still fully local and offline, no server configuration or
network call involved.
The intended flow this unlocks for an agent (or a human) is:
— search → describe → construct and run the real
jf apicall, without ever having to guessat an endpoint's shape.
Behavior
method+path(case-insensitive method,leading
/optional) and returns that one operation, or a clear non-zero-exit error namingthe searched
spec_bundleand pointing back tojf api docs searchif it's not in thecatalog. This is a deliberate contrast with
docs search, which returns an empty match listwith exit 0 — describe targets a single, specific operation, so "not found" is a caller
mistake worth failing on.
--format tablealso available),matching
docs search's existing convention rather than gating on--ai-help.docs/api-spec) now also captures eachoperation's declared
responses(code + description) and, when present, the request body'smedia-type-level
example. Both are rare in the trimmed OSS stub bundle but real in the fullinternal bundle — verified against the actual
rdme-adminreference spec, not just syntheticfixtures.
jf_apione-liner construction asdocs search— the two commands staybyte-for-byte consistent for the same operation.
jf api --ai-helpand thedocs/docs searchhelp text now reference the fullsearch → describe → execute chain, and no longer claim "OpenAPI bundles are not shipped with
the CLI" (stale since JGC-525/526 landed).
Testing
Ran the full QA pass manually against both the stub build and a full build (375 real operations,
rdme-adminreference bundle) built via the internalmake fullflow: exact-lookup success/not-found cases, case-insensitivity, table/JSON rendering, help text, and an end-to-end
search → describe → construct-a-real-call scenario against a real Bridge API operation,
confirming the surfaced parameters/request body/example match the actual spec and that
docs search's anddocs describe'sjf_apione-liners agree exactly.masterbranch.go vet ./....go fmt ./....