-
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.
Merge new-model-changes feature branch to main (#171)
* Adds new model changes for `Structure` (#138) * Adds new model changes for scalar (#143) * Adds changes for sequence data type (#144) * Adds tests for new model changes (#146) * Adds new model changes for Rust code generation (#147) * Adds changes for optional/required fields in Java code generation (#148) * Modifies generated setter API to take nested types instead of nested properties (#153) * Adds support for builder API generation in Java (#154) * Adds support for Java enum generation (#158) * Adds namespace fix for nested sequence and adds support for nested types in Sequence and Scalar ADT (#163) * Adds changes for nested type naming (#166) * Adds support for imports in code generation (#169)
- Loading branch information
Showing
74 changed files
with
2,497 additions
and
1,629 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/bad/enum_type/invalid_case_enum_varaint.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 @@ | ||
FoobarBaz // expected FooBarBaz, found FoobarBaz |
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 @@ | ||
hello // expected (foo, bar, baz or FooBarBaz) found hello |
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 @@ | ||
"foo" // expected a symbol value foo for enum, found string "foo" |
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 |
---|---|---|
|
@@ -6,4 +6,4 @@ | |
D: false, | ||
E: (1 2 3) // expected list | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
12 // expected string | ||
12 // expected string |
1 change: 0 additions & 1 deletion
1
code-gen-projects/input/bad/sequence/mismatched_sequence_element.ion
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/bad/sequence/mismatched_sequence_element_type.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 @@ | ||
[1, 2, 3] // expected list of strings |
2 changes: 1 addition & 1 deletion
2
code-gen-projects/input/bad/sequence/mismatched_sequence_type.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 |
---|---|---|
@@ -1 +1 @@ | ||
("foo" "bar" "baz") // expected list | ||
("foo" "bar" "baz") // expected list |
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/bad/sequence_with_enum_element/invalid_value.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 @@ | ||
[foobar] // expected values are either foo , bar or baz, found foobar. |
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/bad/sequence_with_import/mismatched_sequence_element_type.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 @@ | ||
[ mango ] // expected apple, banana or strawberry, found mango |
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/bad/sequence_with_import/mismatched_sequence_type.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 @@ | ||
(apple banana) // expected list, found sexp |
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
{ | ||
A: "hello", | ||
B: 12, | ||
C: (1 2 3), | ||
C: (1 2 3), // expected sexpression of strings | ||
D: 10e2 | ||
} | ||
|
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/bad/struct_with_enum_fields/mismatched_sequence_type.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 type mismatched sequence type | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: ["foo", "bar", "baz"], // expected sexp | ||
D: 10e2 | ||
} |
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/bad/struct_with_enum_fields/mismatched_type.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 type mismatched fields | ||
{ | ||
A: "hello", | ||
B: false, // expected field type: int | ||
C: ("foo" "bar" "baz"), | ||
D: 10e2 | ||
} |
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/bad/struct_with_enum_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 | ||
} |
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/bad/struct_with_fields/mismatched_sequence_element_type.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 @@ | ||
// struct with mismatched sequence element | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: (1 2 3), // expected sexpression of strings | ||
D: 10e2 | ||
} |
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 |
---|---|---|
|
@@ -5,4 +5,3 @@ | |
C: ("foo" "bar" "baz"), | ||
D: 10e2 | ||
} | ||
|
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 | ||
} |
5 changes: 5 additions & 0 deletions
5
code-gen-projects/input/bad/struct_with_inline_import/mismatched_import_type.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,5 @@ | ||
// simple struct with type mismatched import field | ||
{ | ||
A: "hello", | ||
B: false, // expected field type symbol | ||
} |
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 @@ | ||
foo |
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 @@ | ||
bar |
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 @@ | ||
baz |
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 @@ | ||
FooBarBaz |
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] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,4 +7,3 @@ | |
E: [1, 2, 3] | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// empty string | ||
"" | ||
"" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// a scalar value of string type | ||
"Hello World!" | ||
"Hello World!" |
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 |
---|---|---|
@@ -1 +1 @@ | ||
[] | ||
[] |
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 |
---|---|---|
@@ -1 +1 @@ | ||
["foo", "bar", "baz"] | ||
["foo", "bar", "baz"] |
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/good/sequence_with_enum_element/valid_value.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 @@ | ||
[foo, bar, baz] |
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/good/sequence_with_import/empty_sequence.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 @@ | ||
[] |
1 change: 1 addition & 0 deletions
1
code-gen-projects/input/good/sequence_with_import/valid_elements.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 @@ | ||
[ apple, strawberry ] |
7 changes: 7 additions & 0 deletions
7
code-gen-projects/input/good/struct_with_enum_fields/empty_values.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 @@ | ||
// struct with empty list, empty string and zeros | ||
{ | ||
C: (), | ||
A: "", | ||
B: 0, | ||
D: 0e0, | ||
} |
8 changes: 8 additions & 0 deletions
8
code-gen-projects/input/good/struct_with_enum_fields/valid_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,8 @@ | ||
// simple struct with all valid fields | ||
{ | ||
A: "hello", | ||
B: 12, | ||
C: ("foo" "bar" "baz"), | ||
D: 10e2, | ||
E: foo | ||
} |
8 changes: 8 additions & 0 deletions
8
code-gen-projects/input/good/struct_with_enum_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,8 @@ | ||
// 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 | ||
E: foo, | ||
} |
8 changes: 8 additions & 0 deletions
8
code-gen-projects/input/good/struct_with_enum_fields/valid_unordered_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,8 @@ | ||
// struct with unordered fields | ||
{ | ||
C: ("foo" "bar" "baz"), | ||
A: "hello", | ||
B: 12, | ||
E: foo, | ||
D: 10e2, | ||
} |
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 | ||
} |
1 change: 0 additions & 1 deletion
1
code-gen-projects/input/good/struct_with_fields/valid_unordered_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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
// struct with unordered fields | ||
{ | ||
C: ("foo" "bar" "baz"), | ||
|
5 changes: 5 additions & 0 deletions
5
code-gen-projects/input/good/struct_with_inline_import/valid_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,5 @@ | ||
// simple struct with all valid fields | ||
{ | ||
A: "hello", | ||
B: apple, | ||
} |
5 changes: 5 additions & 0 deletions
5
code-gen-projects/input/good/struct_with_inline_import/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,5 @@ | ||
// simple struct with all valid fields | ||
{ | ||
A: "hello", | ||
// B: apple, // since `B` is an optional field, this is a valid struct | ||
} |
5 changes: 5 additions & 0 deletions
5
code-gen-projects/input/good/struct_with_inline_import/valid_unordered_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,5 @@ | ||
// struct with unordered fields | ||
{ | ||
B: banana, | ||
A: "hello", | ||
} |
Oops, something went wrong.