Created
December 11, 2025 15:06
-
-
Save cdbkr/7f2d59df8cf35d253f2a84941b435faa to your computer and use it in GitHub Desktop.
buildEndpointDescription function
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
| const buildEndpointDescription = (endpoint) => { | |
| const parts = [ | |
| `## ${endpoint.id}`, | |
| `${endpoint.method} ${endpoint.path}`, | |
| endpoint.summary, | |
| endpoint.description, | |
| ].filter(Boolean); | |
| if (endpoint.parameters.length > 0) { | |
| parts.push('\nParameters:', ...endpoint.parameters.map(parameter => ` - ${parameter}`)); | |
| } | |
| if (endpoint.bodySchema) { | |
| parts.push(`\nRequest Body Schema:\n ${endpoint.bodySchema}`); | |
| } | |
| return parts.join('\n') + '\n'; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment