-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supporting other primitives as backing types for enums (#612)
* Supporting other primitives as backing types for enums * Add IT to test serializing int enum to json * Reverting version bump * Add serialization test to match deserialization test * Missing file
- Loading branch information
1 parent
0c2de26
commit 528eb22
Showing
6 changed files
with
192 additions
and
21 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
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
6 changes: 6 additions & 0 deletions
6
jsonschema2pojo-integration-tests/src/test/resources/schema/enum/doubleEnumAsRoot.json
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,6 @@ | ||
{ | ||
"javaType" : "com.example.enums.DoubleEnumAsRoot", | ||
"type" : "number", | ||
"enum" : [1.0, 2.5, 3], | ||
"javaEnumNames" : ["One", "TwoAndAHalf", "Three"] | ||
} |
6 changes: 6 additions & 0 deletions
6
jsonschema2pojo-integration-tests/src/test/resources/schema/enum/integerEnumAsRoot.json
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,6 @@ | ||
{ | ||
"javaType" : "com.example.enums.IntegerEnumAsRoot", | ||
"type" : "integer", | ||
"enum" : [1, 2, 3], | ||
"javaEnumNames" : ["One", "Two", "Three"] | ||
} |
10 changes: 10 additions & 0 deletions
10
jsonschema2pojo-integration-tests/src/test/resources/schema/enum/integerEnumToSerialize.json
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,10 @@ | ||
{ | ||
"javaType" : "com.example.enums.IntegerEnumToSerialize", | ||
"properties" : { | ||
"testEnum" : { | ||
"type" : "integer", | ||
"enum" : [1, 2, 3], | ||
"javaEnumNames" : ["One", "Two", "Three"] | ||
} | ||
} | ||
} |