diff --git a/spec/schemas/_common.query_dsl.yaml b/spec/schemas/_common.query_dsl.yaml index 1b5149d15..c5ec3de39 100644 --- a/spec/schemas/_common.query_dsl.yaml +++ b/spec/schemas/_common.query_dsl.yaml @@ -69,16 +69,13 @@ components: description: |- Returns documents that match a provided text, number, date or boolean value. The provided text is analyzed before matching. - anyOf: - - type: object - additionalProperties: - $ref: '#/components/schemas/MatchQuery' - minProperties: 1 - maxProperties: 1 - - type: object - additionalProperties: true - minProperties: 1 - maxProperties: 1 + type: object + additionalProperties: + anyOf: + - $ref: '#/components/schemas/MatchQuery' + - true + minProperties: 1 + maxProperties: 1 match_all: $ref: '#/components/schemas/MatchAllQuery' match_bool_prefix: diff --git a/tools/src/_utils/index.ts b/tools/src/_utils/index.ts index 2a9c67996..952dc4d7b 100644 --- a/tools/src/_utils/index.ts +++ b/tools/src/_utils/index.ts @@ -11,7 +11,7 @@ import { type OpenAPIV3 } from 'openapi-types' import { type ValidationError } from 'types' export function is_ref (o: MaybeRef): o is OpenAPIV3.ReferenceObject { - return '$ref' in o + return typeof(o) === 'object' && '$ref' in o } export function is_array_schema (schema: OpenAPIV3.SchemaObject): schema is OpenAPIV3.ArraySchemaObject {