Skip to content

docs(asm): add response body examples to all 11 operations#7

Open
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-iE8dL
Open

docs(asm): add response body examples to all 11 operations#7
dmchaledev wants to merge 1 commit into
mainfrom
claude/elegant-edison-iE8dL

Conversation

@dmchaledev
Copy link
Copy Markdown
Contributor

Problem

11 of the 12 operations in asm/openapi.yaml had no example responses. This means:

  • Swagger UI / Redoc display blank "Example Value" sections — the single most-used feature by developers evaluating an API
  • Code generators (openapi-generator, kiota, etc.) produce less useful stub types with no sample data
  • Postman / Insomnia imports show empty response previews
  • Reviewers can't quickly sanity-check that a schema is correct without mentally resolving every $ref

Fix

Added a realistic example: block at the content.application/json level for every success response across all operations, using a consistent fictional tenant (acmecorp.com) so examples tell a coherent story:

Operation Status Example covers
listAssets 200 Paginated list with 2 assets, tags, vuln counts
getAsset 200 Full detail — ports, certificates, owner
updateAsset 200 Post-patch detail with updated tag set
listScans 200 Two scans (completed + running)
triggerScan 202 Queued scan immediately after POST
getScan 200 Completed scan with full summary stats
listVulnerabilities 200 Two vulns at different severities/statuses
getVulnerability 200 Log4Shell with description, remediation, history
updateVulnerability 200 Same vuln after status transition to accepted_risk
listTags 200 Three tags with colours
createTag 201 Newly created tag

Verification

python3 -c "import yaml; yaml.safe_load(open('asm/openapi.yaml'))" && echo "YAML valid"
# → YAML valid

The Spectral CI lint job will also validate the spec on this PR.

https://claude.ai/code/session_013w8uLNCyB2jsGXP7NVGVJT


Generated by Claude Code

11 of 12 operations had no example responses, leaving Swagger UI,
Redoc, and code generators with blank output sections. Added realistic
example payloads (using a consistent acmecorp.com tenant) to every
success response — listAssets, getAsset, updateAsset, listScans,
triggerScan, getScan, listVulnerabilities, getVulnerability,
updateVulnerability, listTags, and createTag.

https://claude.ai/code/session_013w8uLNCyB2jsGXP7NVGVJT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants