Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 30, 2024
1 parent d656963 commit 58ced32
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 22 deletions.
28 changes: 28 additions & 0 deletions tests/level_1_format.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"definitions": {
"Student": {
"type": "struct",
"properties": {
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"date": {
"type": "string",
"format": "date"
},
"dateTime": {
"type": "string",
"format": "date-time"
},
"time": {
"type": "string",
"format": "time"
}
}
}
},
"root": "Student"
}
4 changes: 2 additions & 2 deletions tests/level_2_array_inline_reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"type": "array",
"schema": {
"type": "reference",
"target": "Student_Property"
"target": "StudentProperty"
}
}
}
},
"Student_Property": {
"StudentProperty": {
"type": "struct",
"properties": {
"name": {
Expand Down
8 changes: 4 additions & 4 deletions tests/level_2_array_reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
},
"properties": {
"type": "reference",
"target": "Student_Array_Reference"
"target": "StudentArrayReference"
}
}
},
"Student_Array_Reference": {
"StudentArrayReference": {
"type": "array",
"schema": {
"type": "reference",
"target": "Student_Property"
"target": "StudentProperty"
}
},
"Student_Property": {
"StudentProperty": {
"type": "struct",
"properties": {
"name": {
Expand Down
4 changes: 2 additions & 2 deletions tests/level_2_array_string.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
},
"properties": {
"type": "reference",
"target": "Student_Array_String"
"target": "StudentArrayString"
}
}
},
"Student_Array_String": {
"StudentArrayString": {
"type": "array",
"schema": {
"type": "string"
Expand Down
4 changes: 2 additions & 2 deletions tests/level_2_map_inline_reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"type": "map",
"schema": {
"type": "reference",
"target": "Student_Property"
"target": "StudentProperty"
}
}
}
},
"Student_Property": {
"StudentProperty": {
"type": "struct",
"properties": {
"name": {
Expand Down
8 changes: 4 additions & 4 deletions tests/level_2_map_reference.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
},
"properties": {
"type": "reference",
"target": "Student_Map_Reference"
"target": "StudentMapReference"
}
}
},
"Student_Map_Reference": {
"StudentMapReference": {
"type": "map",
"schema": {
"type": "reference",
"target": "Student_Property"
"target": "StudentProperty"
}
},
"Student_Property": {
"StudentProperty": {
"type": "struct",
"properties": {
"name": {
Expand Down
4 changes: 2 additions & 2 deletions tests/level_2_map_string.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
},
"properties": {
"type": "reference",
"target": "Student_Map_String"
"target": "StudentMapString"
}
}
},
"Student_Map_String": {
"StudentMapString": {
"type": "map",
"schema": {
"type": "string"
Expand Down
3 changes: 2 additions & 1 deletion tests/level_4_generic.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"template": {
"T": "Student"
}
}
},
"properties": {}
},
"Map": {
"type": "struct",
Expand Down
10 changes: 5 additions & 5 deletions tests/level_5_discriminator.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"Location": {
"type": "struct",
"base": true,
"properties": {
"type": {
"type": "string"
}
},
"discriminator": "type",
"mapping": {
"Web": "web",
"World": "world"
},
"properties": {
"type": {
"type": "string"
}
}
},
"Web": {
Expand Down
57 changes: 57 additions & 0 deletions tests/sdkgen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"type": "model-java",
"require": {
"./level_1_format.json": {
"target": "../java/org/typeschema/reflection/dto/level_1_format",
"namespace": "org.typeschema.reflection.dto.level_1_format"
},
"./level_1_simple.json": {
"target": "../java/org/typeschema/reflection/dto/level_1_simple",
"namespace": "org.typeschema.reflection.dto.level_1_simple"
},
"./level_2_array_inline_reference.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_array_inline_reference",
"namespace": "org.typeschema.reflection.dto.level_2_array_inline_reference"
},
"./level_2_array_inline_string.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_array_inline_string",
"namespace": "org.typeschema.reflection.dto.level_2_array_inline_string"
},
"./level_2_array_reference.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_array_reference",
"namespace": "org.typeschema.reflection.dto.level_2_array_reference"
},
"./level_2_array_string.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_array_string",
"namespace": "org.typeschema.reflection.dto.level_2_array_string"
},
"./level_2_map_inline_reference.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_map_inline_reference",
"namespace": "org.typeschema.reflection.dto.level_2_map_inline_reference"
},
"./level_2_map_inline_string.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_map_inline_string",
"namespace": "org.typeschema.reflection.dto.level_2_map_inline_string"
},
"./level_2_map_reference.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_map_reference",
"namespace": "org.typeschema.reflection.dto.level_2_map_reference"
},
"./level_2_map_string.json": {
"target": "../java/org/typeschema/reflection/dto/level_2_map_string",
"namespace": "org.typeschema.reflection.dto.level_2_map_string"
},
"./level_3_inheritance.json": {
"target": "../java/org/typeschema/reflection/dto/level_3_inheritance",
"namespace": "org.typeschema.reflection.dto.level_3_inheritance"
},
"./level_4_generic.json": {
"target": "../java/org/typeschema/reflection/dto/level_4_generic",
"namespace": "org.typeschema.reflection.dto.level_4_generic"
},
"./level_5_discriminator.json": {
"target": "../java/org/typeschema/reflection/dto/level_5_discriminator",
"namespace": "org.typeschema.reflection.dto.level_5_discriminator"
}
}
}

0 comments on commit 58ced32

Please sign in to comment.