Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #13854
Closed
Open
Issue created Oct 28, 2022 by Administrator@rootContributor

[REQ] Auto generated test samples, unit test, integration test

Created by: OmarBouslama

Is your feature request related to a problem? Please describe.

We would like to auto generate tests from open API specs. I can see there testCase holder in this test API file : https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/python/api_test.handlebars#L40 but it is not clear how this works.

I found in the code https://github.com/OpenAPITools/openapi-generator/blob/574a70c3152a6d137db37f4df908fc824d733cc5/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java#L95 that this may come from x-schema-test-examples but it is not clear how to add this to open API yaml

Could please add some example of open API specs that allow tests generation or explain this in the documentation

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Assignee
Assign to
Time tracking