diff --git a/types/swagger-schema-official/index.d.ts b/types/swagger-schema-official/index.d.ts index 4722973cfb..e089d5dfe9 100644 --- a/types/swagger-schema-official/index.d.ts +++ b/types/swagger-schema-official/index.d.ts @@ -47,7 +47,7 @@ export interface BaseParameter { } export interface BodyParameter extends BaseParameter { - schema?: Referenceable; + schema?: Schema; } export interface QueryParameter extends BaseParameter, BaseSchema { @@ -87,19 +87,19 @@ export interface Path { options?: Operation; head?: Operation; patch?: Operation; - parameters?: Array>; + parameters?: Parameter[] | Reference[]; } // ----------------------------- Operation ----------------------------------- export interface Operation { - responses: { [responseName: string]: Referenceable}; + responses: { [responseName: string]: Response | Reference}; summary?: string; description?: string; externalDocs?: ExternalDocs; operationId?: string; produces?: string[]; consumes?: string[]; - parameters?: Array>; + parameters?: Parameter[] | Reference[]; schemes?: string[]; deprecated?: boolean; security?: Security[]; @@ -107,12 +107,14 @@ export interface Operation { } // ----------------------------- Reference ----------------------------------- -export type Referenceable = { $ref: string; } | T; +export interface Reference { + $ref: string; +} // ----------------------------- Response ------------------------------------ export interface Response { description: string; - schema?: Referenceable; + schema?: Schema; headers?: { [headerName: string]: Header }; examples?: { [exampleName: string]: {} }; } @@ -138,14 +140,14 @@ export interface BaseSchema { minProperties?: number; enum?: Array; type?: string; - items?: Referenceable|Array>; + items?: Schema|Schema[]; } export interface Schema extends BaseSchema { $ref?: string; - allOf?: Array>; - additionalProperties?: Referenceable; - properties?: {[propertyName: string]: Referenceable}; + allOf?: Schema[]; + additionalProperties?: Schema; + properties?: {[propertyName: string]: Schema}; discriminator?: string; readOnly?: boolean; xml?: XML; @@ -224,8 +226,8 @@ export interface Spec { schemes?: string[]; consumes?: string[]; produces?: string[]; - paths: {[pathName: string]: Referenceable}; - definitions?: {[definitionsName: string]: Referenceable }; + paths: {[pathName: string]: Path}; + definitions?: {[definitionsName: string]: Schema }; parameters?: {[parameterName: string]: BodyParameter|QueryParameter}; responses?: {[responseName: string]: Response }; security?: Array<{[securityDefinitionName: string]: string[]}>;