-
Notifications
You must be signed in to change notification settings - Fork 0
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
Speakeasy OpenAPI Suggestions -Suggest #6
base: main
Are you sure you want to change the base?
Conversation
security: | ||
- {} | ||
- {} |
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.
Error 2: missing-examples - Missing example for parameter. Consider adding an example
Suggestion 2: Add an example to the 'drinkType' parameter in the GET /drinks endpoint. The example value is 'beer'.
Explanation 2: The OpenAPI spec requires examples for parameters, and the 'drinkType' parameter was missing an example. The example value 'beer' was chosen because it is one of the enumerated values in the 'DrinkType' schema.
required: false | ||
schema: | ||
$ref: '#/components/schemas/DrinkType' | ||
example: beer | ||
responses: | ||
"200": |
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.
Error 3: missing-examples - Missing example for responses. Consider adding an example
Suggestion 3: Add an example to the response of the GET /drinks endpoint. The example should be an array of 'Drink' objects, which matches the response schema.
Explanation 3: The validation error was due to a missing example for responses. The response schema for the 200 status code is an array of 'Drink' objects. By adding an example that matches this schema, we can resolve the validation error.
|
||
/drink/{name}: #TODO: this should be by product code and we should have search by name | ||
$ref: '#/components/responses/UnknownError' | ||
/drink/{name}: |
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.
Error 4: missing-examples - Missing example for parameter. Consider adding an example
Suggestion 4: Add an example 'CocaCola' to the 'name' parameter in the GET /drink/{name} endpoint
Explanation 4: The error message indicates that there is a missing example for a parameter. The parameter in question is 'name' which is a path parameter for the '/drink/{name}' endpoint. Adding an example will resolve the error.
type: string | ||
- name: name | ||
in: path | ||
required: true |
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.
Error 5: missing-examples - Missing example for responses. Consider adding an example
Suggestion 5: Add an example to the response of the 'Get a drink' operation. The example is an object that adheres to the 'Drink' schema, with 'name' set to 'Old Fashioned', 'type' set to 'cocktail', and 'price' set to 1000.
Explanation 5: The error was due to a missing example for responses. The 'Drink' schema, which is used in the response of the 'Get a drink' operation, was missing an example. The suggested fix adds an example that adheres to the 'Drink' schema, thus resolving the error.
Generated OpenAPI Suggestions by Speakeasy CLI.
Outputs changes to ./openapi.yaml.
Error 1: missing-examples - Missing example for requestBody. Consider adding an example
Suggestion 1: Add an example for the requestBody of the POST /authenticate endpoint. The example should be an object with a username and password.
Explanation 1: The error was due to a missing example for the requestBody. Adding an example with a username and password should resolve this error.