openapi3-ts
Advanced tools
Comparing version 0.3.1 to 0.4.1
@@ -11,3 +11,4 @@ "use strict"; | ||
info: { | ||
title: "app" | ||
title: "app", | ||
version: "version" | ||
}, | ||
@@ -14,0 +15,0 @@ paths: {}, |
@@ -9,3 +9,3 @@ import { ISpecificationExtension } from "./SpecificationExtension"; | ||
}; | ||
components: ComponentsObject; | ||
components?: ComponentsObject; | ||
security?: SecurityRequirementObject; | ||
@@ -21,3 +21,3 @@ tags?: TagObject[]; | ||
license?: LicenseObject; | ||
version?: string; | ||
version: string; | ||
} | ||
@@ -31,3 +31,3 @@ export interface ContactObject extends ISpecificationExtension { | ||
name: string; | ||
url: string; | ||
url?: string; | ||
} | ||
@@ -37,3 +37,3 @@ export interface ServerObject extends ISpecificationExtension { | ||
description?: string; | ||
variables: { | ||
variables?: { | ||
[v: string]: ServerVariableObject; | ||
@@ -48,27 +48,27 @@ }; | ||
export interface ComponentsObject extends ISpecificationExtension { | ||
schemas: { | ||
schemas?: { | ||
[schema: string]: SchemaObject; | ||
}; | ||
responses: { | ||
responses?: { | ||
[response: string]: ResponseObject; | ||
}; | ||
parameters: { | ||
parameters?: { | ||
[parameter: string]: ParameterObject; | ||
}; | ||
examples: { | ||
examples?: { | ||
[example: string]: ExampleObject; | ||
}; | ||
requestBodies: { | ||
requestBodies?: { | ||
[request: string]: RequestBodyObject; | ||
}; | ||
headers: { | ||
headers?: { | ||
[heaer: string]: HeaderObject; | ||
}; | ||
securitySchemes: { | ||
securitySchemes?: { | ||
[securityScheme: string]: SecuritySchemeObject; | ||
}; | ||
links: { | ||
links?: { | ||
[link: string]: LinkObject; | ||
}; | ||
callbacks: { | ||
callbacks?: { | ||
[callback: string]: CallbackObject; | ||
@@ -112,4 +112,4 @@ }; | ||
export interface ExternalDocumentationObject extends ISpecificationExtension { | ||
description?: string; | ||
url: string; | ||
description: string; | ||
} | ||
@@ -133,3 +133,3 @@ export interface ParameterObject extends ISpecificationExtension { | ||
description?: string; | ||
content?: ContentObject; | ||
content: ContentObject; | ||
required?: boolean; | ||
@@ -150,13 +150,17 @@ } | ||
export interface EncodingPropertyObject { | ||
contentType: string; | ||
Headers: any; | ||
style: string; | ||
explode: boolean; | ||
contentType?: string; | ||
headers?: { | ||
[key: string]: HeaderObject | ReferenceObject; | ||
}; | ||
style?: string; | ||
explode?: boolean; | ||
allowReserved?: boolean; | ||
[key: string]: any; | ||
} | ||
export interface ResponsesObject extends ISpecificationExtension { | ||
default: ResponseObject | ReferenceObject; | ||
[statuscode: string]: ResponseObject | ResponseObject | any; | ||
[statuscode: string]: ResponseObject | ReferenceObject | any; | ||
} | ||
export interface ResponseObject extends ISpecificationExtension { | ||
description?: string; | ||
description: string; | ||
headers?: HeadersObject; | ||
@@ -176,2 +180,6 @@ content?: ContentObject; | ||
export interface ExampleObject { | ||
summary?: string; | ||
description?: string; | ||
value?: any; | ||
externalValue?: string; | ||
[property: string]: any; | ||
@@ -183,10 +191,12 @@ } | ||
export interface LinkObject extends ISpecificationExtension { | ||
href?: string; | ||
operationRef?: string; | ||
operationId?: string; | ||
parameters?: LinkParametersObject; | ||
headers?: HeadersObject; | ||
requestBody?: any | string; | ||
description?: string; | ||
server?: ServerObject; | ||
[property: string]: any; | ||
} | ||
export interface LinkParametersObject { | ||
[name: string]: any; | ||
[name: string]: any | string; | ||
} | ||
@@ -197,4 +207,5 @@ export interface HeaderObject extends ParameterObject { | ||
name: string; | ||
description: string; | ||
description?: string; | ||
externalDocs?: ExternalDocumentationObject; | ||
[extension: string]: any; | ||
} | ||
@@ -209,3 +220,3 @@ export interface ExamplesObject { | ||
nullable?: boolean; | ||
discriminator?: string; | ||
discriminator?: DiscriminatorObject; | ||
readOnly?: boolean; | ||
@@ -219,9 +230,11 @@ writeOnly?: boolean; | ||
type?: string; | ||
allOf?: SchemaObject | ReferenceObject; | ||
oneOf?: SchemaObject | ReferenceObject; | ||
anyOf?: SchemaObject | ReferenceObject; | ||
allOf?: (SchemaObject | ReferenceObject)[]; | ||
oneOf?: (SchemaObject | ReferenceObject)[]; | ||
anyOf?: (SchemaObject | ReferenceObject)[]; | ||
not?: SchemaObject | ReferenceObject; | ||
items?: SchemaObject | ReferenceObject; | ||
properties?: SchemaObject | ReferenceObject; | ||
additionalProperties?: SchemaObject | ReferenceObject; | ||
properties?: { | ||
[propertyName: string]: (SchemaObject | ReferenceObject); | ||
}; | ||
additionalProperties?: (SchemaObject | ReferenceObject)[]; | ||
description?: string; | ||
@@ -231,14 +244,20 @@ format?: string; | ||
} | ||
export interface DiscriminatorObject { | ||
propertyName: string; | ||
mapping?: { | ||
[key: string]: string; | ||
}; | ||
} | ||
export interface XmlObject extends ISpecificationExtension { | ||
name: string; | ||
namespace: string; | ||
prefix: string; | ||
attribute: boolean; | ||
wrapped: boolean; | ||
name?: string; | ||
namespace?: string; | ||
prefix?: string; | ||
attribute?: boolean; | ||
wrapped?: boolean; | ||
} | ||
export interface SecuritySchemeObject extends ISpecificationExtension { | ||
type: string; | ||
description?: string; | ||
name?: string; | ||
in?: string; | ||
description?: string; | ||
scheme?: string; | ||
@@ -250,6 +269,6 @@ bearerFormat?: string; | ||
export interface OAuthFlowsObject extends ISpecificationExtension { | ||
implicit: OAuthFlowObject; | ||
password: OAuthFlowObject; | ||
clientCredentials: OAuthFlowObject; | ||
authorizationCode: OAuthFlowObject; | ||
implicit?: OAuthFlowObject; | ||
password?: OAuthFlowObject; | ||
clientCredentials?: OAuthFlowObject; | ||
authorizationCode?: OAuthFlowObject; | ||
} | ||
@@ -259,7 +278,7 @@ export interface OAuthFlowObject extends ISpecificationExtension { | ||
tokenUrl: string; | ||
refreshUrl: string; | ||
refreshUrl?: string; | ||
scopes: ScopesObject; | ||
} | ||
export interface ScopesObject extends ISpecificationExtension { | ||
[scope: string]: string | any; | ||
[scope: string]: any; | ||
} | ||
@@ -266,0 +285,0 @@ export interface SecurityRequirementObject { |
{ | ||
"name": "openapi3-ts", | ||
"version": "0.3.1", | ||
"version": "0.4.1", | ||
"description": "TS Model & utils for OpenAPI 3.0.x specification.", | ||
@@ -52,14 +52,14 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/chai": "^4.0.0", | ||
"@types/mocha": "^2.2.41", | ||
"@types/node": "^7.0.22", | ||
"chai": "^4.0.1", | ||
"@types/chai": "^4.0.4", | ||
"@types/mocha": "^2.2.43", | ||
"@types/node": "^8.0.28", | ||
"chai": "^4.1.2", | ||
"coveralls": "^2.13.1", | ||
"mocha": "^3.2.0", | ||
"nyc": "^11.0.1", | ||
"rimraf": "^2.6.1", | ||
"ts-node": "^3.0.4", | ||
"tslint": "^5.4.2", | ||
"typescript": "^2.3.4" | ||
"mocha": "^3.5.3", | ||
"nyc": "^11.2.1", | ||
"rimraf": "^2.6.2", | ||
"ts-node": "^3.3.0", | ||
"tslint": "^5.7.0", | ||
"typescript": "^2.5.2" | ||
} | ||
} |
@@ -30,4 +30,3 @@ # OpenApi3-TS | ||
* OpenAPI spec 3.0.0-RC. [https://github.com/OAI/OpenAPI-Specification/tree/OpenAPI.next](https://github.com/OAI/OpenAPI-Specification/blob/3.0.0-rc0/versions/3.0.md) | ||
* Call for implementers. [Open API Initiative Announces Release of the OpenAPI Spec v3 Implementer’s Draft](https://www.openapis.org/blog/2017/03/01/openapi-spec-3-implementers-draft-released) | ||
* OpenAPI spec 3.0.0. [https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md) | ||
@@ -34,0 +33,0 @@ ## Credits |
@@ -11,3 +11,3 @@ // Typed interfaces for OpenAPI 3.0.0-RC | ||
paths: {[path: string]: PathObject }; | ||
components: ComponentsObject; | ||
components?: ComponentsObject; | ||
security?: SecurityRequirementObject; | ||
@@ -32,3 +32,3 @@ tags?: TagObject[]; | ||
name: string; | ||
url: string; | ||
url?: string; | ||
} | ||
@@ -38,3 +38,3 @@ export interface ServerObject extends ISpecificationExtension { | ||
description?: string; | ||
variables: { [v: string]: ServerVariableObject }; | ||
variables?: { [v: string]: ServerVariableObject }; | ||
} | ||
@@ -47,11 +47,11 @@ export interface ServerVariableObject extends ISpecificationExtension { | ||
export interface ComponentsObject extends ISpecificationExtension { | ||
schemas: { [schema: string]: SchemaObject }; | ||
responses: { [response: string]: ResponseObject }; | ||
parameters: { [parameter: string]: ParameterObject }; | ||
examples: { [example: string]: ExampleObject }; | ||
requestBodies: { [request: string]: RequestBodyObject }; | ||
headers: { [heaer: string]: HeaderObject }; | ||
securitySchemes: { [securityScheme: string]: SecuritySchemeObject }; | ||
links: { [link: string]: LinkObject }; | ||
callbacks: { [callback: string]: CallbackObject }; | ||
schemas?: { [schema: string]: SchemaObject }; | ||
responses?: { [response: string]: ResponseObject }; | ||
parameters?: { [parameter: string]: ParameterObject }; | ||
examples?: { [example: string]: ExampleObject }; | ||
requestBodies?: { [request: string]: RequestBodyObject }; | ||
headers?: { [heaer: string]: HeaderObject }; | ||
securitySchemes?: { [securityScheme: string]: SecuritySchemeObject }; | ||
links?: { [link: string]: LinkObject }; | ||
callbacks?: { [callback: string]: CallbackObject }; | ||
} | ||
@@ -92,4 +92,4 @@ export interface PathObject extends ISpecificationExtension { | ||
export interface ExternalDocumentationObject extends ISpecificationExtension { | ||
description?: string; | ||
url: string; | ||
description: string; | ||
} | ||
@@ -114,3 +114,3 @@ export interface ParameterObject extends ISpecificationExtension { | ||
description?: string; | ||
content?: ContentObject; | ||
content: ContentObject; | ||
required?: boolean; | ||
@@ -132,6 +132,8 @@ } | ||
export interface EncodingPropertyObject { | ||
contentType: string; | ||
Headers: any; | ||
style: string; | ||
explode: boolean; | ||
contentType?: string; | ||
headers?: {[key: string]: HeaderObject | ReferenceObject }; | ||
style?: string; | ||
explode?: boolean; | ||
allowReserved?: boolean; | ||
[key: string]: any; // (any) = Hack for allowing ISpecificationExtension | ||
} | ||
@@ -142,6 +144,6 @@ export interface ResponsesObject extends ISpecificationExtension { | ||
// [statuscode: string]: ResponseObject | ReferenceObject; | ||
[statuscode: string]: ResponseObject | ResponseObject | any; // Hack for allowing ISpecificationExtension | ||
[statuscode: string]: ResponseObject | ReferenceObject | any; // (any) = Hack for allowing ISpecificationExtension | ||
} | ||
export interface ResponseObject extends ISpecificationExtension { | ||
description?: string; | ||
description: string; | ||
headers?: HeadersObject; | ||
@@ -163,3 +165,7 @@ content?: ContentObject; | ||
export interface ExampleObject { | ||
[property: string]: any; | ||
summary?: string; | ||
description?: string; | ||
value?: any; | ||
externalValue?: string; | ||
[property: string]: any; // Hack for allowing ISpecificationExtension | ||
} | ||
@@ -170,10 +176,12 @@ export interface LinksObject { | ||
export interface LinkObject extends ISpecificationExtension { | ||
href?: string; | ||
operationRef?: string; | ||
operationId?: string; | ||
parameters?: LinkParametersObject; | ||
headers?: HeadersObject; | ||
requestBody?: any | string; | ||
description?: string; | ||
server?: ServerObject; | ||
[property: string]: any; // Hack for allowing ISpecificationExtension | ||
} | ||
export interface LinkParametersObject { | ||
[name: string]: any; | ||
[name: string]: any | string; | ||
} | ||
@@ -184,4 +192,5 @@ export interface HeaderObject extends ParameterObject { | ||
name: string; | ||
description: string; | ||
description?: string; | ||
externalDocs?: ExternalDocumentationObject; | ||
[extension: string]: any; // Hack for allowing ISpecificationExtension | ||
} | ||
@@ -196,3 +205,3 @@ export interface ExamplesObject { | ||
nullable?: boolean; | ||
discriminator?: string; | ||
discriminator?: DiscriminatorObject; | ||
readOnly?: boolean; | ||
@@ -218,25 +227,29 @@ writeOnly?: boolean; | ||
} | ||
export interface DiscriminatorObject { | ||
propertyName: string; | ||
mapping?: {[key: string]: string }; | ||
} | ||
export interface XmlObject extends ISpecificationExtension { | ||
name: string; | ||
namespace: string; | ||
prefix: string; | ||
attribute: boolean; | ||
wrapped: boolean; | ||
name?: string; | ||
namespace?: string; | ||
prefix?: string; | ||
attribute?: boolean; | ||
wrapped?: boolean; | ||
} | ||
export interface SecuritySchemeObject extends ISpecificationExtension { | ||
type: string; | ||
name?: string; | ||
in?: string; | ||
type: string; // Valid values are "apiKey", "http", "oauth2", "openIdConnect". | ||
description?: string; | ||
scheme?: string; | ||
name?: string; // required only for apiKey | ||
in?: string; // required only for apiKey | ||
scheme?: string; // required only for http | ||
bearerFormat?: string; | ||
flow?: OAuthFlowObject; | ||
openIdConnectUrl?: string; | ||
flow?: OAuthFlowObject; // required only for oauth2 | ||
openIdConnectUrl?: string; // required only for oauth2 | ||
} | ||
export interface OAuthFlowsObject extends ISpecificationExtension { | ||
implicit: OAuthFlowObject; | ||
password: OAuthFlowObject; | ||
clientCredentials: OAuthFlowObject; | ||
authorizationCode: OAuthFlowObject; | ||
implicit?: OAuthFlowObject; | ||
password?: OAuthFlowObject; | ||
clientCredentials?: OAuthFlowObject; | ||
authorizationCode?: OAuthFlowObject; | ||
} | ||
@@ -246,8 +259,7 @@ export interface OAuthFlowObject extends ISpecificationExtension { | ||
tokenUrl: string; | ||
refreshUrl: string; | ||
refreshUrl?: string; | ||
scopes: ScopesObject; | ||
} | ||
export interface ScopesObject extends ISpecificationExtension { | ||
// [scope: string]: string; | ||
[scope: string]: string | any; // Hack for allowing ISpecificationExtension | ||
[scope: string]: any; // Hack for allowing ISpecificationExtension | ||
} | ||
@@ -254,0 +266,0 @@ export interface SecurityRequirementObject { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124735
1461
35