-
Notifications
You must be signed in to change notification settings - Fork 0
Add happy path examples and Links to OpenAPI documentation #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: davideme <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the OpenAPI specification by adding comprehensive examples and operational workflow links to improve developer experience. The changes provide realistic API interaction examples for all CRUD operations and implement OpenAPI 3.0 Links to document relationships between operations.
- Added 8 happy path examples showing successful API interactions for all endpoints
- Implemented 10 OpenAPI Links to document operational workflows between endpoints
- Enhanced documentation with consistent example data using proper UUID patterns and timestamps
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -48,13 +90,60 @@ paths: | |||
application/json: | |||
schema: | |||
$ref: '#/components/schemas/LampCreate' | |||
examples: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The examples are placed at the wrong level in the YAML structure. They should be nested under the media type (application/json) rather than at the requestBody level.
Copilot uses AI. Check for mistakes.
status: false | ||
createdAt: "2024-01-15T10:15:45Z" | ||
updatedAt: "2024-01-15T10:15:45Z" | ||
links: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The links section is incorrectly indented. It should be at the same level as the response content, not nested within the 201 response.
Copilot uses AI. Check for mistakes.
Enhanced the OpenAPI specification at
docs/api/openapi.yaml
to improve developer experience by adding comprehensive happy path examples and operational workflow links.Changes Made
Happy Path Examples (8 total)
Added realistic, successful API interaction examples for all CRUD operations:
lamps_list
(multiple lamps with pagination) andempty_list
(no lamps) examplescreated_lamp_on
andcreated_lamp_off
examples showing lamp creation with different initial stateslamp_on
andlamp_off
examples demonstrating individual lamp retrievalupdated_to_on
andupdated_to_off
examples showing status updatesOpenAPI 3.0 Links (10 total)
Implemented Links to document relationships between operations, enabling better workflow understanding:
Example Data Quality
046b6c7f-0b8a-43b9-b35d-6489e6daee91
)createdAt
andupdatedAt
fieldsnextCursor
andhasMore
fieldsValidation
This enhancement significantly improves API documentation usability by providing clear examples of successful API interactions and showing how operations relate to each other in typical workflows.
Fixes #127.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.