swagger-api / swagger-api/swagger-codegen

Contract based unit tests

Open
#4,087 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature General: Suggestion
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

Currently there are no unittests ensuring that the contracts (i.e. the outcome of the language-generators) change only when they are supposed to change. What about adding at least one unittest for each language to secure this and to track all the generated output files (better their hashes)? For different configuration options of the language maybe additional tests make sense. I think this would also track breaking changes a lot easier...

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 by locating the language-generators and existing unit-test setup, then review how generated output files and configuration options are represented. Establish contract checks for the supported languages; done means tests detect unintended changes to generated output and track the relevant hashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
testing, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.