-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds changes for optional/required fields in Java code generation (#148)
- Loading branch information
Showing
13 changed files
with
350 additions
and
89 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/bad/struct_with_fields/missing_required_fields.ion
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,7 @@ | ||
// simple struct with all valid fields | ||
{ | ||
A: "hello", | ||
B: 12, | ||
// C: ("foo" "bar" "baz"), // since `C` is a required field, this is an invalid struct | ||
D: 10e2 | ||
} |
9 changes: 9 additions & 0 deletions
9
code-gen-projects/input/good/nested_struct/valid_optional_fields.ion
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,9 @@ | ||
// nested struct with some optional fields that are not provided | ||
{ | ||
A: "hello", | ||
// B: 12, // since `B` is optional field, this is a valid struct | ||
C: { | ||
D: false, | ||
E: [1, 2, 3] | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/good/struct_with_fields/valid_optional_fields.ion
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,7 @@ | ||
// simple struct with all valid fields | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: ("foo" "bar" "baz"), | ||
// D: 10e2, // since `D` is optional field, this is a valid struct | ||
} |
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
Oops, something went wrong.