swagger-api / swagger-api/swagger-codegen

[3.0] Use requestBody examples as test data for API tests

Open
#10,472 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.