From 4015adfc098a7149ad36e60d087feb7496734571 Mon Sep 17 00:00:00 2001 From: Laura Trotta <153528055+l-trotta@users.noreply.github.com> Date: Wed, 5 Feb 2025 14:58:07 +0100 Subject: [PATCH] nullable types in anomaly cause, missing field (#3707) (cherry picked from commit 7c6161b8e91e4fbbdf5d69b462a0e9f73d75e4b1) --- output/openapi/elasticsearch-openapi.json | 48 ++++++++-------------- output/schema/schema.json | 49 ++++++++++++++--------- output/typescript/types.ts | 31 +++++++------- specification/ml/_types/Anomaly.ts | 31 +++++++------- 4 files changed, 79 insertions(+), 80 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 1039289a41..7c1e70c103 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -79918,6 +79918,9 @@ "function_description": { "type": "string" }, + "geo_results": { + "$ref": "#/components/schemas/ml._types:GeoResults" + }, "influencers": { "type": "array", "items": { @@ -79947,22 +79950,22 @@ } }, "required": [ - "actual", - "by_field_name", - "by_field_value", - "correlated_by_field_value", - "field_name", - "function", - "function_description", - "influencers", - "over_field_name", - "over_field_value", - "partition_field_name", - "partition_field_value", - "probability", - "typical" + "probability" ] }, + "ml._types:GeoResults": { + "type": "object", + "properties": { + "actual_point": { + "description": "The actual value for the bucket formatted as a `geo_point`.", + "type": "string" + }, + "typical_point": { + "description": "The typical value for the bucket formatted as a `geo_point`.", + "type": "string" + } + } + }, "ml._types:Influence": { "type": "object", "properties": { @@ -79981,23 +79984,6 @@ "influencer_field_values" ] }, - "ml._types:GeoResults": { - "type": "object", - "properties": { - "actual_point": { - "description": "The actual value for the bucket formatted as a `geo_point`.", - "type": "string" - }, - "typical_point": { - "description": "The typical value for the bucket formatted as a `geo_point`.", - "type": "string" - } - }, - "required": [ - "actual_point", - "typical_point" - ] - }, "ml._types:Include": { "type": "string", "enum": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index 86d2e27596..be0371f214 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -156806,7 +156806,7 @@ "properties": [ { "name": "actual", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { @@ -156820,7 +156820,7 @@ }, { "name": "by_field_name", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156831,7 +156831,7 @@ }, { "name": "by_field_value", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156842,7 +156842,7 @@ }, { "name": "correlated_by_field_value", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156853,7 +156853,7 @@ }, { "name": "field_name", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156864,7 +156864,7 @@ }, { "name": "function", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156875,7 +156875,7 @@ }, { "name": "function_description", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156884,9 +156884,20 @@ } } }, + { + "name": "geo_results", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "GeoResults", + "namespace": "ml._types" + } + } + }, { "name": "influencers", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { @@ -156900,7 +156911,7 @@ }, { "name": "over_field_name", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156911,7 +156922,7 @@ }, { "name": "over_field_value", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156922,7 +156933,7 @@ }, { "name": "partition_field_name", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156933,7 +156944,7 @@ }, { "name": "partition_field_value", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -156955,7 +156966,7 @@ }, { "name": "typical", - "required": true, + "required": false, "type": { "kind": "array_of", "value": { @@ -156968,7 +156979,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L123-L138" + "specLocation": "ml/_types/Anomaly.ts#L123-L139" }, { "kind": "interface", @@ -157098,7 +157109,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L156-L197" + "specLocation": "ml/_types/Anomaly.ts#L157-L198" }, { "kind": "interface", @@ -162359,7 +162370,7 @@ { "description": "The actual value for the bucket formatted as a `geo_point`.", "name": "actual_point", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -162371,7 +162382,7 @@ { "description": "The typical value for the bucket formatted as a `geo_point`.", "name": "typical_point", - "required": true, + "required": false, "type": { "kind": "instance_of", "type": { @@ -162381,7 +162392,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L145-L154" + "specLocation": "ml/_types/Anomaly.ts#L146-L155" }, { "kind": "interface", @@ -163153,7 +163164,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L140-L143" + "specLocation": "ml/_types/Anomaly.ts#L141-L144" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 8a9483cca6..602a7ecbf4 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -14110,20 +14110,21 @@ export interface MlAnomaly { } export interface MlAnomalyCause { - actual: double[] - by_field_name: Name - by_field_value: string - correlated_by_field_value: string - field_name: Field - function: string - function_description: string - influencers: MlInfluence[] - over_field_name: Name - over_field_value: string - partition_field_name: string - partition_field_value: string + actual?: double[] + by_field_name?: Name + by_field_value?: string + correlated_by_field_value?: string + field_name?: Field + function?: string + function_description?: string + geo_results?: MlGeoResults + influencers?: MlInfluence[] + over_field_name?: Name + over_field_value?: string + partition_field_name?: string + partition_field_value?: string probability: double - typical: double[] + typical?: double[] } export interface MlAnomalyExplanation { @@ -14692,8 +14693,8 @@ export interface MlFilterRef { export type MlFilterType = 'include' | 'exclude' export interface MlGeoResults { - actual_point: string - typical_point: string + actual_point?: string + typical_point?: string } export interface MlHyperparameter { diff --git a/specification/ml/_types/Anomaly.ts b/specification/ml/_types/Anomaly.ts index f0d95dff1c..dc2bd477b2 100644 --- a/specification/ml/_types/Anomaly.ts +++ b/specification/ml/_types/Anomaly.ts @@ -121,20 +121,21 @@ export class Anomaly { } export class AnomalyCause { - actual: double[] - by_field_name: Name - by_field_value: string - correlated_by_field_value: string - field_name: Field - function: string - function_description: string - influencers: Influence[] - over_field_name: Name - over_field_value: string - partition_field_name: string - partition_field_value: string + actual?: double[] + by_field_name?: Name + by_field_value?: string + correlated_by_field_value?: string + field_name?: Field + function?: string + function_description?: string + geo_results?: GeoResults + influencers?: Influence[] + over_field_name?: Name + over_field_value?: string + partition_field_name?: string + partition_field_value?: string probability: double - typical: double[] + typical?: double[] } export class Influence { @@ -146,11 +147,11 @@ export class GeoResults { /** * The actual value for the bucket formatted as a `geo_point`. */ - actual_point: string + actual_point?: string /** * The typical value for the bucket formatted as a `geo_point`. */ - typical_point: string + typical_point?: string } export class AnomalyExplanation {