Skip to content

Commit 9c0b917

Browse files
committed
Change union type in favor a unique string
Add comments to clarify usage and intent in requests & responses
1 parent 410d6fe commit 9c0b917

File tree

4 files changed

+33
-18
lines changed

4 files changed

+33
-18
lines changed

output/schema/schema.json

Lines changed: 20 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/security/_types/Privileges.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,16 @@ export class IndicesPrivileges {
101101
allow_restricted_indices?: boolean
102102
}
103103

104+
/**
105+
* While creating or updating a role you can provide either a JSON structure or a string to the API.
106+
* However, the response provided by Elasticsearch will only be string with a json-as-text content.
107+
*
108+
* Since this is embedded in IndicesPrivileges, the same structure is used for clarity in both contexts.
109+
*
110+
* @codegen_names text, query, template
111+
*/
104112
export type IndicesPrivilegesQuery =
105-
| string[]
113+
| string
106114
| QueryContainer
107115
| RoleTemplateQueryContainer
108116

specification/security/get_user_privileges/SecurityGetUserPrivilegesResponse.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ export class Response {
2828
applications: ApplicationPrivileges[]
2929
cluster: string[]
3030
global: GlobalPrivilege[]
31+
/**
32+
* In this context IndicesPrivileges.query property can only be a string, see IndicesPrivileges documentation for detail.
33+
*/
3134
indices: IndicesPrivileges[]
3235
run_as: string[]
3336
}

0 commit comments

Comments
 (0)