Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,6 @@ public void testIssue11323() throws IOException {

SpringCodegen codegen = new SpringCodegen();
codegen.setOutputDir(output.getAbsolutePath());
//codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");

ClientOptInput input = new ClientOptInput();
input.openAPI(openAPI);
Expand Down Expand Up @@ -1322,4 +1321,34 @@ public void shouldSetDefaultValueForMultipleArrayItems() throws IOException {
.assertParameterAnnotations()
.containsWithNameAndAttributes("RequestParam", ImmutableMap.of("defaultValue", "\"\""));
}

@Test(enabled = false)
// TODO Test case reproduces issue #11696. Enable when the issue is fixed.
public void testIssue11696() throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
String outputPath = output.getAbsolutePath().replace('\\', '/');

OpenAPI openAPI = new OpenAPIParser()
.readLocation("src/test/resources/3_0/spring/issue_11696.yml", null, new ParseOptions()).getOpenAPI();

SpringCodegen codegen = new SpringCodegen();
codegen.setOutputDir(output.getAbsolutePath());

ClientOptInput input = new ClientOptInput();
input.openAPI(openAPI);
input.config(codegen);

DefaultGenerator generator = new DefaultGenerator();

generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false");
generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false");
generator.opts(input).generate();

assertFileNotContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/MyType.java"),
"putCategoryItem");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
openapi: 3.0.1
info:
title: Test Issue #11696
version: v1
paths:
/test:
get:
responses:
'200':
description: default response
content:
'*/*':
schema:
$ref: '#/components/schemas/MyType'
components:
schemas:
MyType:
required:
- category
type: object
properties:
category:
type: object
description: |-
<strong>Type:</strong> Category<br/>
The category
allOf:
- $ref: '#/components/schemas/Category'
Category:
type: object
properties:
name:
type: string