diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 571273965..76e021311 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -24068,15 +24068,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" ] } } @@ -24091,19 +24098,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" ] } } @@ -24205,6 +24205,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 88afa05be..87508dc79 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -14908,15 +14908,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" ] } } @@ -14931,19 +14938,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" ] } } @@ -15045,6 +15045,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 562b83f24..f78c62d30 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -7765,7 +7765,7 @@ "name": "query_rules.put_ruleset", "request": { "name": "Request", - "namespace": "query_rules.test" + "namespace": "query_rules.put_ruleset" }, "requestBodyRequired": true, "requestMediaType": [ @@ -7773,7 +7773,7 @@ ], "response": { "name": "Response", - "namespace": "query_rules.test" + "namespace": "query_rules.put_ruleset" }, "responseMediaType": [ "application/json" @@ -7787,6 +7787,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": { @@ -35247,6 +35285,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" @@ -137518,7 +137644,7 @@ } } ], - "specLocation": "query_rules/test/types.ts#L21-L30" + "specLocation": "query_rules/test/QueryRulesetTestResponse.ts#L30-L39" }, { "kind": "interface",