Add isSkipOperationExample check before generating op.requestBodyExamples in the DefaultCodeGe. This avoids the running out of heap space error one gets when generating a large spec file (#11144)

Co-authored-by: Kristopher Tadlock <tadlockk@infintech.com>
This commit is contained in:
KristopherTadlock 2022-01-02 02:14:46 -08:00 committed by GitHub
parent 2db3e6bb25
commit a20cee3024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4103,7 +4103,7 @@ public class DefaultCodegen implements CodegenConfig {
}
// add example
if (schemas != null) {
if (schemas != null && !isSkipOperationExample()) {
op.requestBodyExamples = new ExampleGenerator(schemas, this.openAPI).generate(null, new ArrayList<>(getConsumesInfo(this.openAPI, operation)), bodyParam.baseType);
}
}