From d7d5476e2d06ca021d7521bf3ed7692c862e2e10 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Mon, 14 Aug 2023 14:52:57 +0200 Subject: [PATCH] PR remarks --- .../_spec_utils/{FlagsEnum.ts => PipeSeparatedFlags.ts} | 6 +++--- specification/_types/query_dsl/fulltext.ts | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) rename specification/_spec_utils/{FlagsEnum.ts => PipeSeparatedFlags.ts} (84%) diff --git a/specification/_spec_utils/FlagsEnum.ts b/specification/_spec_utils/PipeSeparatedFlags.ts similarity index 84% rename from specification/_spec_utils/FlagsEnum.ts rename to specification/_spec_utils/PipeSeparatedFlags.ts index c26d2c18b2..7b0b7881a2 100644 --- a/specification/_spec_utils/FlagsEnum.ts +++ b/specification/_spec_utils/PipeSeparatedFlags.ts @@ -18,10 +18,10 @@ */ /** - * This type type marks the underlaying enum as a "flags enum". Individual members of flags enums - * are combined using the pipe separator ("A|B|C|..."). + * A set of flags that can be represented as a single enum value or a set of values that are encoded + * as a pipe-separated string * * Depending on the target language, code generators can use this hint to generate language specific * flags enum constructs and the corresponding (de-)serialization code. */ -export type FlagsEnum = T +export type PipeSeparatedFlags = T | string diff --git a/specification/_types/query_dsl/fulltext.ts b/specification/_types/query_dsl/fulltext.ts index 14194f7fb6..b71d65ae26 100644 --- a/specification/_types/query_dsl/fulltext.ts +++ b/specification/_types/query_dsl/fulltext.ts @@ -29,7 +29,7 @@ import { Script } from '@_types/Scripting' import { QueryBase } from './abstractions' import { Operator } from './Operator' import { DateMath, TimeZone } from '@_types/Time' -import { FlagsEnum } from '@spec_utils/FlagsEnum' +import { FlagsEnum, PipeSeparatedFlags } from '@spec_utils/PipeSeparatedFlags' /** * @shortcut_property query @@ -703,7 +703,7 @@ export class QueryStringQuery extends QueryBase { * Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX` * @doc_id supported-flags */ -export type SimpleQueryStringFlags = FlagsEnum +export type SimpleQueryStringFlags = PipeSeparatedFlags export enum SimpleQueryStringFlag { /** @@ -722,7 +722,6 @@ export enum SimpleQueryStringFlag { * Enables the `\|` OR operator. */ OR = 1 << 2, - /** * Enables the `*` prefix operator. */