Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 6, 2023

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.

levels and product codes otherwise it will only include public information.
security:
- {}
- {}
Copy link
Contributor Author

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.

$ref: '#/components/schemas/DrinkType'
example: beer
responses:
"200":
Copy link
Contributor Author

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}:
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

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