Skip to content

Commit

Permalink
Updated Resource Schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
CI committed Jan 9, 2024
1 parent 8575b64 commit 1c1a9b3
Show file tree
Hide file tree
Showing 5 changed files with 268 additions and 9 deletions.
30 changes: 29 additions & 1 deletion schemas/km/connector/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -2266,6 +2266,19 @@
]
}
},
"fieldFormatConfig": {
"type": "object",
"title": "Field Format Configuration",
"additionalProperties": false,
"description": "The configuration of the field format",
"properties": {
"listDelimiter": {
"type": "string",
"title": "List Delimiter",
"description": "The delimiter for the list field."
}
}
},
"mapping": {
"type": "object",
"description": "The mapping generated by the transformers.",
Expand All @@ -2280,6 +2293,9 @@
"title": "Field",
"description": "The reference to the field resource."
},
"fieldFormatConfig": {
"$ref": "#/definitions/fieldFormatConfig"
},
"subfieldPath": {
"$ref": "#/definitions/subfieldPath"
},
Expand All @@ -2288,6 +2304,15 @@
"title": "Clear Value if Blank",
"default": false,
"description": "If true, blank values that are mapped to a field will clear existing field content."
},
"listSettings": {
"type": "string",
"title": "List Settings",
"description": "Describes how a list should be updated.",
"enum": [
"ADD_TO_EXISTING",
"REPLACE_EXISTING"
]
}
},
"required": [
Expand Down Expand Up @@ -2485,7 +2510,7 @@
"type": "array",
"title": "Subfield Path",
"additionalItems": false,
"description": "Path to a particular property or list item index.",
"description": "Path to a particular property or list item index. Includes field format settings if applicable.",
"items": {
"type": "object",
"additionalProperties": false,
Expand All @@ -2499,6 +2524,9 @@
"type": "number",
"title": "Index",
"description": "An index which identifies an item in a list value."
},
"fieldFormatConfig": {
"$ref": "#/definitions/fieldFormatConfig"
}
},
"oneOf": [
Expand Down
30 changes: 29 additions & 1 deletion schemas/km/connector/v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -2266,6 +2266,19 @@
]
}
},
"fieldFormatConfig": {
"type": "object",
"title": "Field Format Configuration",
"additionalProperties": false,
"description": "The configuration of the field format",
"properties": {
"listDelimiter": {
"type": "string",
"title": "List Delimiter",
"description": "The delimiter for the list field."
}
}
},
"mapping": {
"type": "object",
"description": "The mapping generated by the transformers.",
Expand All @@ -2280,6 +2293,9 @@
"title": "Field",
"description": "The reference to the field resource."
},
"fieldFormatConfig": {
"$ref": "#/definitions/fieldFormatConfig"
},
"subfieldPath": {
"$ref": "#/definitions/subfieldPath"
},
Expand All @@ -2288,6 +2304,15 @@
"title": "Clear Value if Blank",
"default": false,
"description": "If true, blank values that are mapped to a field will clear existing field content."
},
"listSettings": {
"type": "string",
"title": "List Settings",
"description": "Describes how a list should be updated.",
"enum": [
"ADD_TO_EXISTING",
"REPLACE_EXISTING"
]
}
},
"required": [
Expand Down Expand Up @@ -2485,7 +2510,7 @@
"type": "array",
"title": "Subfield Path",
"additionalItems": false,
"description": "Path to a particular property or list item index.",
"description": "Path to a particular property or list item index. Includes field format settings if applicable.",
"items": {
"type": "object",
"additionalProperties": false,
Expand All @@ -2499,6 +2524,9 @@
"type": "number",
"title": "Index",
"description": "An index which identifies an item in a list value."
},
"fieldFormatConfig": {
"$ref": "#/definitions/fieldFormatConfig"
}
},
"oneOf": [
Expand Down
18 changes: 11 additions & 7 deletions schemas/km/field-computation/current.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.yext.com/config/km/field-computation",
"$version": "1.2",
"$version": "2",
"type": "object",
"additionalProperties": false,
"title": "Field Computation",
Expand All @@ -11,7 +11,7 @@
"type": "string"
},
"$schema": {
"const": "https://schema.yext.com/config/km/field-computation/v1"
"const": "https://schema.yext.com/config/km/field-computation/v2"
},
"field": {
"type": "string",
Expand All @@ -26,17 +26,21 @@
"$ref": "#/definitions/computation"
}
},
"systemControlled": {
"type": "boolean"
"automaticComputationsBehavior": {
"type": "string",
"title": "Automatic Computations Behavior",
"description": "Designates the behavior for automatic computations",
"enum": [
"SUGGEST",
"WRITE_DIRECTLY",
"DISABLED"
]
},
"inputs": {
"$ref": "#/definitions/inputs"
},
"localizedInputs": {
"$ref": "#/definitions/localizedInputs"
},
"automatic": {
"type": "boolean"
}
},
"oneOf": [
Expand Down
1 change: 1 addition & 0 deletions schemas/km/field-computation/v1.2.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.yext.com/config/km/field-computation",
"$version": "1.2",
"$deprecationDate": "2024-01-08",
"type": "object",
"additionalProperties": false,
"title": "Field Computation",
Expand Down
198 changes: 198 additions & 0 deletions schemas/km/field-computation/v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema.yext.com/config/km/field-computation",
"$version": "2",
"type": "object",
"additionalProperties": false,
"title": "Field Computation",
"description": "A resource that represents the configuration of a Field Computation.",
"properties": {
"$id": {
"type": "string"
},
"$schema": {
"const": "https://schema.yext.com/config/km/field-computation/v2"
},
"field": {
"type": "string",
"format": "km/field"
},
"computationMethod": {
"type": "string"
},
"computations": {
"type": "array",
"items": {
"$ref": "#/definitions/computation"
}
},
"automaticComputationsBehavior": {
"type": "string",
"title": "Automatic Computations Behavior",
"description": "Designates the behavior for automatic computations",
"enum": [
"SUGGEST",
"WRITE_DIRECTLY",
"DISABLED"
]
},
"inputs": {
"$ref": "#/definitions/inputs"
},
"localizedInputs": {
"$ref": "#/definitions/localizedInputs"
}
},
"oneOf": [
{
"required": [
"$id",
"$schema",
"field",
"computationMethod"
],
"anyOf": [
{
"required": [
"inputs"
]
},
{
"required": [
"localizedInputs"
]
}
],
"not": {
"anyOf": [
{
"required": [
"computations"
]
}
]
}
},
{
"required": [
"$id",
"$schema",
"field",
"computations"
],
"not": {
"anyOf": [
{
"required": [
"computationMethod"
]
},
{
"required": [
"inputs"
]
},
{
"required": [
"localizedInputs"
]
}
]
}
}
],
"definitions": {
"computation": {
"type": "object",
"properties": {
"subfieldPath": {
"type": "string"
},
"computationMethod": {
"type": "string"
},
"inputs": {
"$ref": "#/definitions/inputs"
},
"localizedInputs": {
"$ref": "#/definitions/localizedInputs"
}
},
"additionalProperties": false,
"anyOf": [
{
"required": [
"subfieldPath",
"computationMethod",
"inputs"
]
},
{
"required": [
"subfieldPath",
"computationMethod",
"localizedInputs"
]
}
]
},
"inputs": {
"type": "object",
"description": "A model that represents the input values",
"patternProperties": {
"^[a-zA-Z0-9]+$": {
"type": [
"string",
"number",
"array",
"boolean",
"object",
"integer",
"null"
]
}
},
"additionalProperties": false
},
"localizedInputs": {
"type": "object",
"description": "A model that represents the localized input values",
"patternProperties": {
"^[a-zA-Z0-9]+$": {
"type": "object",
"properties": {
"default": {
"type": [
"string",
"number",
"array",
"boolean",
"object",
"integer",
"null"
]
}
},
"patternProperties": {
"^[a-zA-Z-_]+$": {
"type": [
"string",
"number",
"array",
"boolean",
"object",
"integer",
"null"
]
}
},
"required": [
"default"
],
"additionalProperties": false
}
},
"additionalProperties": false
}
}
}

0 comments on commit 1c1a9b3

Please sign in to comment.