Skip to content

Introduce HttpStatusCode Response type #373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 37 additions & 37 deletions output/schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -62189,6 +62189,32 @@
}
]
},
{
"attachedBehaviors": [
"EmptyResponseBase"
],
"behaviors": [
{
"type": {
"name": "EmptyResponseBase",
"namespace": "_spec_utils"
}
}
],
"description": "Empty Response body, with the result defined by the HTTP status code",
"inherits": {
"type": {
"name": "ResponseBase",
"namespace": "_types"
}
},
"kind": "interface",
"name": {
"name": "HttpStatusCodeResponseBase",
"namespace": "_types"
},
"properties": []
},
{
"inherits": {
"type": {
Expand Down Expand Up @@ -94399,17 +94425,9 @@
"attachedBehaviors": [
"EmptyResponseBase"
],
"behaviors": [
{
"type": {
"name": "EmptyResponseBase",
"namespace": "_spec_utils"
}
}
],
"inherits": {
"type": {
"name": "ResponseBase",
"name": "HttpStatusCodeResponseBase",
"namespace": "_types"
}
},
Expand Down Expand Up @@ -110899,9 +110917,12 @@
]
},
{
"attachedBehaviors": [
"EmptyResponseBase"
],
"inherits": {
"type": {
"name": "ResponseBase",
"name": "HttpStatusCodeResponseBase",
"namespace": "_types"
}
},
Expand All @@ -110910,19 +110931,7 @@
"name": "SecurityDisableUserResponse",
"namespace": "security.disable_user"
},
"properties": [
{
"name": "stub",
"required": true,
"type": {
"kind": "instance_of",
"type": {
"name": "integer",
"namespace": "_types"
}
}
}
]
"properties": []
},
{
"attachedBehaviors": [
Expand Down Expand Up @@ -110968,9 +110977,12 @@
]
},
{
"attachedBehaviors": [
"EmptyResponseBase"
],
"inherits": {
"type": {
"name": "ResponseBase",
"name": "HttpStatusCodeResponseBase",
"namespace": "_types"
}
},
Expand All @@ -110979,19 +110991,7 @@
"name": "SecurityEnableUserResponse",
"namespace": "security.enable_user"
},
"properties": [
{
"name": "stub",
"required": true,
"type": {
"kind": "instance_of",
"type": {
"name": "integer",
"namespace": "_types"
}
}
}
]
"properties": []
},
{
"kind": "interface",
Expand Down
11 changes: 5 additions & 6 deletions output/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6106,6 +6106,9 @@ export interface NodesNodesStatsHttpStats {
total_opened: long
}

export interface HttpStatusCodeResponseBase extends ResponseBase {
}

export interface AnalysisTokenFiltersHunspellTokenFilter extends AnalysisTokenFiltersTokenFilterBase {
dedup: boolean
dictionary: string
Expand Down Expand Up @@ -11619,18 +11622,14 @@ export interface SecurityDisableUserSecurityDisableUserRequest extends RequestBa
refresh?: Refresh
}

export interface SecurityDisableUserSecurityDisableUserResponse extends ResponseBase {
stub: integer
}
export type SecurityDisableUserSecurityDisableUserResponse = boolean

export interface SecurityEnableUserSecurityEnableUserRequest extends RequestBase {
username: Username
refresh?: Refresh
}

export interface SecurityEnableUserSecurityEnableUserResponse extends ResponseBase {
stub: integer
}
export type SecurityEnableUserSecurityEnableUserResponse = boolean

export interface XpackUsageSecurityFeatureToggle {
enabled: boolean
Expand Down
5 changes: 2 additions & 3 deletions specification/_global/ping/PingResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

import { EmptyResponseBase } from '@spec_utils/behaviors'
import { ResponseBase } from '@_types/Base'
import { HttpStatusCodeResponseBase } from '@_types/Base'

export class PingResponse extends ResponseBase implements EmptyResponseBase {}
export class PingResponse extends HttpStatusCodeResponseBase {}
8 changes: 8 additions & 0 deletions specification/_types/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/

import { CommonQueryParameters } from '@spec_utils/behaviors'
import { EmptyResponseBase } from '_spec_utils/behaviors'
import {
Id,
IndexName,
Expand Down Expand Up @@ -59,6 +60,13 @@ export class DictionaryResponseBase<TKey, TValue> extends ResponseBase {}

export class DynamicResponseBase extends ResponseBase {}

/**
* Empty Response body, with the result defined by the HTTP status code
*/
export class HttpStatusCodeResponseBase
extends ResponseBase
implements EmptyResponseBase {}

export class ElasticsearchVersionInfo {
build_date: DateString
build_flavor: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* under the License.
*/

import { ResponseBase } from '@_types/Base'
import { integer } from '@_types/Numeric'
import { HttpStatusCodeResponseBase } from '@_types/Base'

export class SecurityDisableUserResponse extends ResponseBase {
stub: integer
}
export class SecurityDisableUserResponse extends HttpStatusCodeResponseBase {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* under the License.
*/

import { ResponseBase } from '@_types/Base'
import { integer } from '@_types/Numeric'
import { HttpStatusCodeResponseBase } from '@_types/Base'

export class SecurityEnableUserResponse extends ResponseBase {
stub: integer
}
export class SecurityEnableUserResponse extends HttpStatusCodeResponseBase {}