-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#11323] Fixed wrong clearing of CodegenModel#hasEnum field
A CodegenModel's hasEnum property is set in addVars: cm.hasEnums = true; This state was cleared afterwards again. As one of its results the import for @JsonValue was not added for the model class in the Spring code generator, where 'model.hasEnums' was evaluated to false where it should be true.
- Loading branch information
Karsten Thoms
committed
Feb 18, 2022
1 parent
0d4dba1
commit f8d4b3d
Showing
3 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
modules/openapi-generator/src/test/resources/3_0/spring/issue_11323.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: Test Issue #11323 | ||
version: v1 | ||
paths: | ||
/test: | ||
get: | ||
responses: | ||
'200': | ||
description: default response | ||
content: | ||
'*/*': | ||
schema: | ||
$ref: '#/components/schemas/Address' | ||
components: | ||
schemas: | ||
Address: | ||
type: object | ||
properties: | ||
locationType: | ||
type: string | ||
enum: | ||
- VILLAGE | ||
- SMALL_TOWN | ||
- BIG_CITY | ||
allOf: | ||
- $ref: '#/components/schemas/BasicAddress' | ||
|
||
BasicAddress: | ||
type: object | ||
properties: | ||
street: | ||
type: string | ||
housenumber: | ||
type: string | ||
zip: | ||
type: string | ||
city: | ||
type: string | ||
country: | ||
type: string |