fixed issue with STI on non-tables
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
[
|
||||
{
|
||||
"description": "Vertical family Routing (Across Tables)",
|
||||
"description": "Vertical family Routing (Scenario A)",
|
||||
"database": {
|
||||
"types": [
|
||||
{
|
||||
@ -153,7 +153,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Matrix family Routing (Vertical + Horizontal Intersections)",
|
||||
"description": "Matrix family Routing (Scenario B)",
|
||||
"database": {
|
||||
"types": [
|
||||
{
|
||||
@ -284,7 +284,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "Horizontal family Routing (Virtual Variations)",
|
||||
"description": "Horizontal family Routing (Scenario C)",
|
||||
"database": {
|
||||
"types": [
|
||||
{
|
||||
@ -776,5 +776,123 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "JSONB Field Bubble family Routing (Scenario D)",
|
||||
"database": {
|
||||
"types": [
|
||||
{
|
||||
"name": "dashboard",
|
||||
"variations": [
|
||||
"dashboard"
|
||||
],
|
||||
"schemas": {
|
||||
"dashboard": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"panel": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"kind"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"kind": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"balance.panel": {
|
||||
"type": "panel",
|
||||
"properties": {
|
||||
"amount": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"units.panel": {
|
||||
"type": "panel",
|
||||
"properties": {
|
||||
"count": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "family_panel",
|
||||
"schemas": {
|
||||
"family_panel": {
|
||||
"family": "panel"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"tests": [
|
||||
{
|
||||
"description": "Successfully routes to nested balance panel",
|
||||
"schema_id": "family_panel",
|
||||
"data": {
|
||||
"id": "123",
|
||||
"kind": "balance",
|
||||
"amount": 500
|
||||
},
|
||||
"action": "validate",
|
||||
"expect": {
|
||||
"success": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Fails validation on routed schema due to invalid property type",
|
||||
"schema_id": "family_panel",
|
||||
"data": {
|
||||
"id": "123",
|
||||
"kind": "balance",
|
||||
"amount": "not_an_int"
|
||||
},
|
||||
"action": "validate",
|
||||
"expect": {
|
||||
"success": false,
|
||||
"errors": [
|
||||
{
|
||||
"code": "INVALID_TYPE",
|
||||
"details": {
|
||||
"path": "amount"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"description": "Fails when discriminator does not match any bubble schema",
|
||||
"schema_id": "family_panel",
|
||||
"data": {
|
||||
"id": "123",
|
||||
"kind": "unknown_panel"
|
||||
},
|
||||
"action": "validate",
|
||||
"expect": {
|
||||
"success": false,
|
||||
"errors": [
|
||||
{
|
||||
"code": "NO_FAMILY_MATCH",
|
||||
"details": {
|
||||
"path": ""
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user