swagger-api / swagger-api/swagger-codegen
[3.0] Use requestBody examples as test data for API tests
Open
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Currently DefaultApiTest.java comes with
SomeRequestBody = null;
but if there is "examples" field for request body - why don't use it?
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md#example-object-examples
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the generated DefaultApiTest.java and the OpenAPI 3.0.3 Example Object documentation linked in the issue. Trace how requestBody examples are represented for API tests, then verify that an example replaces the current null request body in generated tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi
- Domain
- api, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100