Consider summary for operation if description is empty#71
Open
nougad wants to merge 3 commits into
Open
Conversation
Some openapi definitions are unfortunately bit brief and only specify the `summary` field and not `description`. But there should be no harm to use `summary` if no `description` is found. Example file: https://intervals.icu/api/v1/docs
Some APIs give an overview in summary and further notes in description. But just having description is not conveying the full picture. Using both should work best.
ivo-toby
requested changes
Dec 30, 2025
ivo-toby
left a comment
Owner
There was a problem hiding this comment.
Thanks for your contribution! I have a minor suggestion that aligns closer with OpenAPI spec
|
|
||
| const nameSource = op.operationId || op.summary || `${method.toUpperCase()} ${path}` | ||
| const name = this.abbreviateOperationId(nameSource) | ||
| const description = [op.summary, op.description].filter(x => x).join("\n"); |
Owner
There was a problem hiding this comment.
Concatenating might create overly verbose tool descriptions.
Suggested change
| const description = [op.summary, op.description].filter(x => x).join("\n"); | |
| const description = op.description || op.summary || `Make a ${method.toUpperCase()} request to ${path}`; |
this matches OpenAPI conventions where description is the primary documentation field and summary is the brief version
| const tool: ExtendedTool = { | ||
| name, | ||
| description: op.description || `Make a ${method.toUpperCase()} request to ${path}`, | ||
| description: description || `Make a ${method.toUpperCase()} request to ${path}`, |
Owner
There was a problem hiding this comment.
After previous change this can be simplified to:
Suggested change
| description: description || `Make a ${method.toUpperCase()} request to ${path}`, | |
| description, |
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.
Some openapi definitions are unfortunately bit brief and only specify the
summaryfield and notdescription. But there should be no harm to usesummaryif nodescriptionis found.Example file: https://intervals.icu/api/v1/docs