Skip to content

Commit 6c72df1

Browse files
committed
Enum order is lost
1 parent 5f3748f commit 6c72df1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,10 @@ import javax.annotation.processing.Generated;
206206

207207
@Generated("com.cosium.json_schema_to_java_record_api.GenerateRecordsFromJsonSchemas")
208208
public enum Country {
209-
MOROCCO,
210-
FRANCE
209+
FRANCE,
210+
MOROCCO
211211
}
212+
212213
```
213214

214215
## Making a generated type implement interfaces
@@ -248,8 +249,8 @@ import javax.annotation.processing.Generated;
248249

249250
@Generated("com.cosium.json_schema_to_java_record_api.GenerateRecordsFromJsonSchemas")
250251
public enum Country implements Location {
251-
MOROCCO,
252-
FRANCE
252+
FRANCE,
253+
MOROCCO
253254
}
254255
```
255256

core/src/main/java/com/cosium/json_schema_to_java_record/JsonSchemaContent.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ record JsonSchemaContent(
3333
Type type,
3434
@Nullable String format,
3535
@Nullable JsonSchemaContent items,
36-
@Nullable Set<Object> enumeration,
36+
@Nullable List<Object> enumeration,
3737
Map<String, JsonSchemaContent> properties,
3838
Set<String> required) {
3939

@@ -46,7 +46,7 @@ record JsonSchemaContent(
4646
@JsonProperty("type") @Nullable String type,
4747
@JsonProperty("format") @Nullable String format,
4848
@JsonProperty("items") @Nullable JsonSchemaContent items,
49-
@JsonProperty("enum") @Nullable Set<Object> enumeration,
49+
@JsonProperty("enum") @Nullable List<Object> enumeration,
5050
@JsonProperty("properties") @Nullable Map<String, JsonSchemaContent> properties,
5151
@JsonProperty("required") @Nullable Set<String> required) {
5252
this(

0 commit comments

Comments
 (0)