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
  • Merge requests
  • !11144

Add isSkipOperationExample check before generating op.requestBodyExamples

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/KristopherTadlock/master into master Dec 16, 2021
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: KristopherTadlock

Add isSkipOperationExample check before generating op.requestBodyExamples in the DefaultCodeGe. This avoids the running out of heap space error you can get when generating a large spec file, even with the skipOperationExample flag is set to true under additional properties.

Example command:

java -jar ./openapi-generator-cli.jar generate -i http://localhost:5000/swagger/v1/swagger.json --additional-properties=skipOperationExample=true -g dart -o ../server-api -c ./openapi-gen-config.yaml

Now skips example code generation in the body as well when the flag is set to true. Before this would only skip op.examples but generate would still run for op.requestBodyExamples which would blow up the heap stack with no way to disable it.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/KristopherTadlock/master