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
  • #8229
Closed
Open
Issue created Dec 18, 2020 by Administrator@rootContributor

[REQ] Allow generators to override example creation when no examples are provided in the spec

Created by: tekerson

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

We have a custom generator and the examples are used as mock data for testing. By default, if there are no examples provided in the spec, the generator creates examples based on the schema of the response. These automatically created examples aren't desirable to be used in this context.

Describe the solution you'd like

We would like to be able to customise (or, more specifically prevent) the creation of example data when it is not explicitly provided in the spec files.

Describe alternatives you've considered

We currently have a workaround that involves post-hoc filtering of the examples list, but this currently relies on the type of the generated example being the only way that a Map gets added to the list, which doesn't seem very reliable.

Additional context

I have created a draft PR (#8225) with a potential implementation.

Assignee
Assign to
Time tracking