gjson pathing for stem paths
This commit is contained in:
@ -1148,7 +1148,7 @@
|
||||
"description": "Full person stem query on phone number contact",
|
||||
"action": "query",
|
||||
"schema_id": "full.person",
|
||||
"stem": "phone_numbers/contact",
|
||||
"stem": "phone_numbers.#",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
@ -1172,7 +1172,7 @@
|
||||
"description": "Full person stem query on phone number contact on phone number",
|
||||
"action": "query",
|
||||
"schema_id": "full.person",
|
||||
"stem": "phone_numbers/contact/phone_number",
|
||||
"stem": "phone_numbers.#.target",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
@ -1195,7 +1195,7 @@
|
||||
"description": "Full person stem query on contact email address",
|
||||
"action": "query",
|
||||
"schema_id": "full.person",
|
||||
"stem": "contacts/contact/email_address",
|
||||
"stem": "contacts.#.target#(type==\"email_address\")",
|
||||
"expect": {
|
||||
"success": true,
|
||||
"sql": [
|
||||
|
||||
@ -10,9 +10,13 @@
|
||||
"type": "relation",
|
||||
"constraint": "fk_contact_entity",
|
||||
"source_type": "contact",
|
||||
"source_columns": ["entity_id"],
|
||||
"source_columns": [
|
||||
"entity_id"
|
||||
],
|
||||
"destination_type": "person",
|
||||
"destination_columns": ["id"],
|
||||
"destination_columns": [
|
||||
"id"
|
||||
],
|
||||
"prefix": null
|
||||
},
|
||||
{
|
||||
@ -20,88 +24,132 @@
|
||||
"type": "relation",
|
||||
"constraint": "fk_relationship_target",
|
||||
"source_type": "relationship",
|
||||
"source_columns": ["target_id", "target_type"],
|
||||
"source_columns": [
|
||||
"target_id",
|
||||
"target_type"
|
||||
],
|
||||
"destination_type": "entity",
|
||||
"destination_columns": ["id", "type"],
|
||||
"destination_columns": [
|
||||
"id",
|
||||
"type"
|
||||
],
|
||||
"prefix": "target"
|
||||
}
|
||||
],
|
||||
"types": [
|
||||
{
|
||||
"name": "entity",
|
||||
"hierarchy": ["entity"],
|
||||
"schemas": [{
|
||||
"$id": "entity",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}]
|
||||
"hierarchy": [
|
||||
"entity"
|
||||
],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "entity",
|
||||
"type": "object",
|
||||
"properties": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "person",
|
||||
"hierarchy": ["person", "entity"],
|
||||
"schemas": [{
|
||||
"$id": "person",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}]
|
||||
"hierarchy": [
|
||||
"person",
|
||||
"entity"
|
||||
],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "person",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "email_address",
|
||||
"hierarchy": ["email_address", "entity"],
|
||||
"schemas": [{
|
||||
"$id": "email_address",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}]
|
||||
"hierarchy": [
|
||||
"email_address",
|
||||
"entity"
|
||||
],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "email_address",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "phone_number",
|
||||
"hierarchy": ["phone_number", "entity"],
|
||||
"schemas": [{
|
||||
"$id": "phone_number",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}]
|
||||
"hierarchy": [
|
||||
"phone_number",
|
||||
"entity"
|
||||
],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "phone_number",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relationship",
|
||||
"relationship": true,
|
||||
"hierarchy": ["relationship", "entity"],
|
||||
"schemas": [{
|
||||
"$id": "relationship",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}]
|
||||
"hierarchy": [
|
||||
"relationship",
|
||||
"entity"
|
||||
],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "relationship",
|
||||
"$ref": "entity",
|
||||
"properties": {}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "contact",
|
||||
"relationship": true,
|
||||
"hierarchy": ["contact", "relationship", "entity"],
|
||||
"schemas": [{
|
||||
"$id": "contact",
|
||||
"$ref": "relationship",
|
||||
"properties": {
|
||||
"target": {
|
||||
"oneOf": [
|
||||
{ "$ref": "phone_number" },
|
||||
{ "$ref": "email_address" }
|
||||
]
|
||||
"hierarchy": [
|
||||
"contact",
|
||||
"relationship",
|
||||
"entity"
|
||||
],
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "contact",
|
||||
"$ref": "relationship",
|
||||
"properties": {
|
||||
"target": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "phone_number"
|
||||
},
|
||||
{
|
||||
"$ref": "email_address"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "save_person",
|
||||
"schemas": [{
|
||||
"$id": "save_person.response",
|
||||
"$ref": "person",
|
||||
"properties": {
|
||||
"contacts": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "contact" }
|
||||
"schemas": [
|
||||
{
|
||||
"$id": "save_person.response",
|
||||
"$ref": "person",
|
||||
"properties": {
|
||||
"contacts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "contact"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -116,15 +164,15 @@
|
||||
"": {
|
||||
"type": "person"
|
||||
},
|
||||
"contacts/contact": {
|
||||
"contacts.#": {
|
||||
"type": "contact",
|
||||
"relation": "contacts_id"
|
||||
},
|
||||
"contacts/contact/email_address": {
|
||||
"contacts.#.target#(type==\"email_address\")": {
|
||||
"type": "email_address",
|
||||
"relation": "target_id"
|
||||
},
|
||||
"contacts/contact/phone_number": {
|
||||
"contacts.#.target#(type==\"phone_number\")": {
|
||||
"type": "phone_number",
|
||||
"relation": "target_id"
|
||||
}
|
||||
@ -133,11 +181,11 @@
|
||||
"": {
|
||||
"type": "contact"
|
||||
},
|
||||
"email_address": {
|
||||
"target#(type==\"email_address\")": {
|
||||
"type": "email_address",
|
||||
"relation": "target_id"
|
||||
},
|
||||
"phone_number": {
|
||||
"target#(type==\"phone_number\")": {
|
||||
"type": "phone_number",
|
||||
"relation": "target_id"
|
||||
}
|
||||
@ -152,7 +200,7 @@
|
||||
"type": "email_address"
|
||||
}
|
||||
},
|
||||
"phone_number": {
|
||||
"phone_number": {
|
||||
"": {
|
||||
"type": "phone_number"
|
||||
}
|
||||
@ -172,4 +220,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
Reference in New Issue
Block a user