diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index c6c7d0c5de..bd2b7eab24 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -24087,15 +24087,22 @@ "schema": { "type": "object", "properties": { - "match_criteria": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "rules": { + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + } + } + ] } }, "required": [ - "match_criteria" + "rules" ] } } @@ -24110,19 +24117,12 @@ "schema": { "type": "object", "properties": { - "total_matched_rules": { - "type": "number" - }, - "matched_rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules.test:QueryRulesetMatchedRule" - } + "result": { + "$ref": "#/components/schemas/_types:Result" } }, "required": [ - "total_matched_rules", - "matched_rules" + "result" ] } } @@ -24224,6 +24224,77 @@ "x-state": "Added in 8.10.0" } }, + "/_query_rules/{ruleset_id}/_test": { + "post": { + "tags": [ + "query_rules" + ], + "summary": "Creates or updates a query ruleset", + "operationId": "query-rules-test", + "parameters": [ + { + "in": "path", + "name": "ruleset_id", + "description": "The unique identifier of the query ruleset to be created or updated", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "match_criteria": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "required": [ + "match_criteria" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "total_matched_rules": { + "type": "number" + }, + "matched_rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules.test:QueryRulesetMatchedRule" + } + } + }, + "required": [ + "total_matched_rules", + "matched_rules" + ] + } + } + } + } + }, + "x-state": "Added in 8.10.0" + } + }, "/_rank_eval": { "get": { "tags": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index fdf497f6dc..44fc5ea466 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -14682,15 +14682,22 @@ "schema": { "type": "object", "properties": { - "match_criteria": { - "type": "object", - "additionalProperties": { - "type": "object" - } + "rules": { + "oneOf": [ + { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules._types:QueryRule" + } + } + ] } }, "required": [ - "match_criteria" + "rules" ] } } @@ -14705,19 +14712,12 @@ "schema": { "type": "object", "properties": { - "total_matched_rules": { - "type": "number" - }, - "matched_rules": { - "type": "array", - "items": { - "$ref": "#/components/schemas/query_rules.test:QueryRulesetMatchedRule" - } + "result": { + "$ref": "#/components/schemas/_types:Result" } }, "required": [ - "total_matched_rules", - "matched_rules" + "result" ] } } @@ -14819,6 +14819,77 @@ "x-state": "Added in 8.10.0" } }, + "/_query_rules/{ruleset_id}/_test": { + "post": { + "tags": [ + "query_rules" + ], + "summary": "Creates or updates a query ruleset", + "operationId": "query-rules-test", + "parameters": [ + { + "in": "path", + "name": "ruleset_id", + "description": "The unique identifier of the query ruleset to be created or updated", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types:Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "match_criteria": { + "type": "object", + "additionalProperties": { + "type": "object" + } + } + }, + "required": [ + "match_criteria" + ] + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "total_matched_rules": { + "type": "number" + }, + "matched_rules": { + "type": "array", + "items": { + "$ref": "#/components/schemas/query_rules.test:QueryRulesetMatchedRule" + } + } + }, + "required": [ + "total_matched_rules", + "matched_rules" + ] + } + } + } + } + }, + "x-state": "Added in 8.10.0" + } + }, "/_rank_eval": { "get": { "tags": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index e5452146bc..09e0fa18a4 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -7612,7 +7612,7 @@ "name": "query_rules.put_ruleset", "request": { "name": "Request", - "namespace": "query_rules.test" + "namespace": "query_rules.put_ruleset" }, "requestBodyRequired": true, "requestMediaType": [ @@ -7620,7 +7620,7 @@ ], "response": { "name": "Response", - "namespace": "query_rules.test" + "namespace": "query_rules.put_ruleset" }, "responseMediaType": [ "application/json" @@ -7634,6 +7634,44 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, + "stack": { + "since": "8.10.0", + "stability": "stable" + } + }, + "description": "Creates or updates a query ruleset.", + "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/test-query-ruleset.html", + "name": "query_rules.test", + "request": { + "name": "Request", + "namespace": "query_rules.test" + }, + "requestBodyRequired": true, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "query_rules.test" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "POST" + ], + "path": "/_query_rules/{ruleset_id}/_test" + } + ] + }, { "availability": { "serverless": { @@ -34737,6 +34775,94 @@ }, "specLocation": "query_rules/put_rule/QueryRulePutResponse.ts#L22-L26" }, + { + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "name": "rules", + "required": true, + "type": { + "items": [ + { + "kind": "instance_of", + "type": { + "name": "QueryRule", + "namespace": "query_rules._types" + } + }, + { + "kind": "array_of", + "value": { + "kind": "instance_of", + "type": { + "name": "QueryRule", + "namespace": "query_rules._types" + } + } + } + ], + "kind": "union_of" + } + } + ] + }, + "description": "Creates or updates a query ruleset.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "kind": "request", + "name": { + "name": "Request", + "namespace": "query_rules.put_ruleset" + }, + "path": [ + { + "description": "The unique identifier of the query ruleset to be created or updated", + "name": "ruleset_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "query_rules/put_ruleset/QueryRulesetPutRequest.ts#L23-L43" + }, + { + "body": { + "kind": "properties", + "properties": [ + { + "name": "result", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Result", + "namespace": "_types" + } + } + } + ] + }, + "kind": "response", + "name": { + "name": "Response", + "namespace": "query_rules.put_ruleset" + }, + "specLocation": "query_rules/put_ruleset/QueryRulesetPutResponse.ts#L22-L26" + }, { "attachedBehaviors": [ "CommonQueryParameters" @@ -137505,7 +137631,7 @@ } } ], - "specLocation": "query_rules/test/types.ts#L21-L30" + "specLocation": "query_rules/test/QueryRulesetTestResponse.ts#L30-L39" }, { "kind": "interface",