@tsed/openspec 8.11.0 → 8.11.2-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/common/OpenSpecExternalDocs.js +0 -1
- package/lib/esm/common/OpenSpecHash.js +0 -1
- package/lib/esm/common/OpenSpecInfo.js +0 -1
- package/lib/esm/common/OpenSpecJsonSchema.js +0 -1
- package/lib/esm/common/OpenSpecPath.js +0 -1
- package/lib/esm/common/OpenSpecRef.js +0 -1
- package/lib/esm/common/OpenSpecSecurity.js +0 -1
- package/lib/esm/common/OpenSpecTag.js +0 -1
- package/lib/esm/common/OpenSpecTypes.js +0 -1
- package/lib/esm/common/OpenSpecVersions.js +0 -1
- package/lib/esm/common/OpenSpecXML.js +0 -1
- package/lib/esm/index.js +0 -1
- package/lib/esm/openspec2/OS2Header.js +0 -1
- package/lib/esm/openspec2/OS2Operation.js +0 -1
- package/lib/esm/openspec2/OS2Parameter.js +0 -1
- package/lib/esm/openspec2/OS2Paths.js +0 -1
- package/lib/esm/openspec2/OS2Response.js +0 -1
- package/lib/esm/openspec2/OS2Schema.js +0 -1
- package/lib/esm/openspec2/OS2Security.js +0 -1
- package/lib/esm/openspec2/OpenSpec2.js +0 -1
- package/lib/esm/openspec3/OS3Callbacks.js +0 -1
- package/lib/esm/openspec3/OS3Components.js +0 -1
- package/lib/esm/openspec3/OS3Encoding.js +0 -1
- package/lib/esm/openspec3/OS3Example.js +0 -1
- package/lib/esm/openspec3/OS3Flows.js +0 -1
- package/lib/esm/openspec3/OS3Header.js +0 -1
- package/lib/esm/openspec3/OS3Link.js +0 -1
- package/lib/esm/openspec3/OS3MediaType.js +0 -1
- package/lib/esm/openspec3/OS3Operation.js +0 -1
- package/lib/esm/openspec3/OS3Parameter.js +0 -1
- package/lib/esm/openspec3/OS3Paths.js +0 -1
- package/lib/esm/openspec3/OS3RequestBody.js +0 -1
- package/lib/esm/openspec3/OS3Response.js +0 -1
- package/lib/esm/openspec3/OS3Schema.js +0 -1
- package/lib/esm/openspec3/OS3Security.js +0 -1
- package/lib/esm/openspec3/OS3Server.js +0 -1
- package/lib/esm/openspec3/OpenSpec3.js +0 -1
- package/package.json +7 -4
- package/lib/esm/common/OpenSpecExternalDocs.js.map +0 -1
- package/lib/esm/common/OpenSpecHash.js.map +0 -1
- package/lib/esm/common/OpenSpecInfo.js.map +0 -1
- package/lib/esm/common/OpenSpecJsonSchema.js.map +0 -1
- package/lib/esm/common/OpenSpecPath.js.map +0 -1
- package/lib/esm/common/OpenSpecRef.js.map +0 -1
- package/lib/esm/common/OpenSpecSecurity.js.map +0 -1
- package/lib/esm/common/OpenSpecTag.js.map +0 -1
- package/lib/esm/common/OpenSpecTypes.js.map +0 -1
- package/lib/esm/common/OpenSpecVersions.js.map +0 -1
- package/lib/esm/common/OpenSpecXML.js.map +0 -1
- package/lib/esm/index.js.map +0 -1
- package/lib/esm/openspec2/OS2Header.js.map +0 -1
- package/lib/esm/openspec2/OS2Operation.js.map +0 -1
- package/lib/esm/openspec2/OS2Parameter.js.map +0 -1
- package/lib/esm/openspec2/OS2Paths.js.map +0 -1
- package/lib/esm/openspec2/OS2Response.js.map +0 -1
- package/lib/esm/openspec2/OS2Schema.js.map +0 -1
- package/lib/esm/openspec2/OS2Security.js.map +0 -1
- package/lib/esm/openspec2/OpenSpec2.js.map +0 -1
- package/lib/esm/openspec3/OS3Callbacks.js.map +0 -1
- package/lib/esm/openspec3/OS3Components.js.map +0 -1
- package/lib/esm/openspec3/OS3Encoding.js.map +0 -1
- package/lib/esm/openspec3/OS3Example.js.map +0 -1
- package/lib/esm/openspec3/OS3Flows.js.map +0 -1
- package/lib/esm/openspec3/OS3Header.js.map +0 -1
- package/lib/esm/openspec3/OS3Link.js.map +0 -1
- package/lib/esm/openspec3/OS3MediaType.js.map +0 -1
- package/lib/esm/openspec3/OS3Operation.js.map +0 -1
- package/lib/esm/openspec3/OS3Parameter.js.map +0 -1
- package/lib/esm/openspec3/OS3Paths.js.map +0 -1
- package/lib/esm/openspec3/OS3RequestBody.js.map +0 -1
- package/lib/esm/openspec3/OS3Response.js.map +0 -1
- package/lib/esm/openspec3/OS3Schema.js.map +0 -1
- package/lib/esm/openspec3/OS3Security.js.map +0 -1
- package/lib/esm/openspec3/OS3Server.js.map +0 -1
- package/lib/esm/openspec3/OpenSpec3.js.map +0 -1
- package/src/common/OpenSpecExternalDocs.ts +0 -10
- package/src/common/OpenSpecHash.ts +0 -1
- package/src/common/OpenSpecInfo.ts +0 -52
- package/src/common/OpenSpecJsonSchema.ts +0 -153
- package/src/common/OpenSpecPath.ts +0 -10
- package/src/common/OpenSpecRef.ts +0 -3
- package/src/common/OpenSpecSecurity.ts +0 -3
- package/src/common/OpenSpecTag.ts +0 -7
- package/src/common/OpenSpecTypes.ts +0 -1
- package/src/common/OpenSpecVersions.ts +0 -3
- package/src/common/OpenSpecXML.ts +0 -22
- package/src/index.ts +0 -39
- package/src/openspec2/OS2Header.ts +0 -8
- package/src/openspec2/OS2Operation.ts +0 -65
- package/src/openspec2/OS2Parameter.ts +0 -65
- package/src/openspec2/OS2Paths.ts +0 -8
- package/src/openspec2/OS2Response.ts +0 -22
- package/src/openspec2/OS2Schema.ts +0 -39
- package/src/openspec2/OS2Security.ts +0 -58
- package/src/openspec2/OpenSpec2.ts +0 -73
- package/src/openspec3/OS3Callbacks.ts +0 -5
- package/src/openspec3/OS3Components.ts +0 -49
- package/src/openspec3/OS3Encoding.ts +0 -25
- package/src/openspec3/OS3Example.ts +0 -19
- package/src/openspec3/OS3Flows.ts +0 -49
- package/src/openspec3/OS3Header.ts +0 -18
- package/src/openspec3/OS3Link.ts +0 -25
- package/src/openspec3/OS3MediaType.ts +0 -24
- package/src/openspec3/OS3Operation.ts +0 -70
- package/src/openspec3/OS3Parameter.ts +0 -83
- package/src/openspec3/OS3Paths.ts +0 -29
- package/src/openspec3/OS3RequestBody.ts +0 -22
- package/src/openspec3/OS3Response.ts +0 -25
- package/src/openspec3/OS3Schema.ts +0 -51
- package/src/openspec3/OS3Security.ts +0 -63
- package/src/openspec3/OS3Server.ts +0 -31
- package/src/openspec3/OpenSpec3.ts +0 -44
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js";
|
|
2
|
-
import {OpenSpecHash} from "../common/OpenSpecHash.js";
|
|
3
|
-
import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js";
|
|
4
|
-
import {OS3Callbacks} from "./OS3Callbacks.js";
|
|
5
|
-
import {OS3Parameter} from "./OS3Parameter.js";
|
|
6
|
-
import {OS3RequestBody} from "./OS3RequestBody.js";
|
|
7
|
-
import {OS3Response} from "./OS3Response.js";
|
|
8
|
-
import {OS3Schema} from "./OS3Schema.js";
|
|
9
|
-
import {OS3Server} from "./OS3Server.js";
|
|
10
|
-
|
|
11
|
-
export interface OS3Operation<Schema = OS3Schema, Parameter = OS3Parameter<Schema>, Response = OpenSpecHash<OS3Response<Schema>>> {
|
|
12
|
-
/**
|
|
13
|
-
* Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is RECOMMENDED to follow common programming naming conventions.
|
|
14
|
-
*/
|
|
15
|
-
operationId: string;
|
|
16
|
-
/**
|
|
17
|
-
* A verbose explanation of the operation behavior. CommonMark syntax MAY be used for rich text representation.
|
|
18
|
-
*/
|
|
19
|
-
description?: string;
|
|
20
|
-
/**
|
|
21
|
-
* A short summary of what the operation does.
|
|
22
|
-
*/
|
|
23
|
-
summary?: string;
|
|
24
|
-
/**
|
|
25
|
-
* A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
|
|
26
|
-
*/
|
|
27
|
-
tags?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Additional external documentation for this operation.
|
|
30
|
-
*/
|
|
31
|
-
externalDocs?: OpenSpecExternalDocs;
|
|
32
|
-
/**
|
|
33
|
-
* A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#pathItemParameters),
|
|
34
|
-
* the new definition will override it but can never remove it.
|
|
35
|
-
* The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterName) and (location)[https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterIn].
|
|
36
|
-
* The list can use the [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#referenceObject) to link to parameters that are defined at the [OpenAPI Object's components/parameters](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#componentsParameters).
|
|
37
|
-
*/
|
|
38
|
-
parameters?: Parameter[];
|
|
39
|
-
/**
|
|
40
|
-
* The request body applicable for this operation.
|
|
41
|
-
* The requestBody is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies.
|
|
42
|
-
* In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.
|
|
43
|
-
*/
|
|
44
|
-
requestBody?: OS3RequestBody<Schema>;
|
|
45
|
-
/**
|
|
46
|
-
* The list of possible responses as they are returned from executing this operation.
|
|
47
|
-
*/
|
|
48
|
-
responses: Response;
|
|
49
|
-
/**
|
|
50
|
-
* Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is false.
|
|
51
|
-
*/
|
|
52
|
-
deprecated?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used.
|
|
55
|
-
* Only one of the security requirement objects need to be satisfied to authorize a request.
|
|
56
|
-
* This definition overrides any declared top-level [security](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#oasSecurity). To remove a top-level security declaration, an empty array can be used.
|
|
57
|
-
*/
|
|
58
|
-
security?: OpenSpecSecurity;
|
|
59
|
-
/**
|
|
60
|
-
* An alternative server array to service this operation. If an alternative server object is specified at the Path Item Object or Root level, it will be overridden by this value.
|
|
61
|
-
*/
|
|
62
|
-
servers?: OS3Server[];
|
|
63
|
-
/**
|
|
64
|
-
* A map of possible out-of band callbacks related to the parent operation.
|
|
65
|
-
* The key is a unique identifier for the [Callback Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#callbackObject).
|
|
66
|
-
* Each value in the map is a Callback Object that describes a request that may be initiated by the API provider and the expected responses.
|
|
67
|
-
* The key value used to identify the callback object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.
|
|
68
|
-
*/
|
|
69
|
-
callbacks?: OS3Callbacks<Schema>;
|
|
70
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import {OpenSpecHash} from "../common/OpenSpecHash.js";
|
|
2
|
-
import {OpenSpecRef} from "../common/OpenSpecRef.js";
|
|
3
|
-
import {OS3Example} from "./OS3Example.js";
|
|
4
|
-
import {OS3MediaType} from "./OS3MediaType.js";
|
|
5
|
-
import {OS3Schema} from "./OS3Schema.js";
|
|
6
|
-
|
|
7
|
-
export type OS3StyleParameter = "matrix" | "label" | "form" | "simple" | "spaceDelimited" | "pipeDelimited" | "deepObject";
|
|
8
|
-
|
|
9
|
-
export interface OS3Parameter<Schema = OS3Schema> {
|
|
10
|
-
/**
|
|
11
|
-
*The name of the parameter. Parameter names are case sensitive.
|
|
12
|
-
*
|
|
13
|
-
* - If [`in`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterIn) is `"path"`, the `name` field MUST correspond to the associated [path](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#pathsPath) segment from the path field in the [Paths Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#pathsObject). See [Path Templating](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#pathTemplating) for further information.
|
|
14
|
-
* - If [`in`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterIn) is `"header"` and the `name` field is `"Accept"`, `"Content-Type"` or `"Authorization"`, the parameter definition SHALL be ignored.
|
|
15
|
-
* - For all other cases, the `name` corresponds to the parameter name used by the [`in`](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#parameterIn) property.
|
|
16
|
-
*/
|
|
17
|
-
name: string;
|
|
18
|
-
/**
|
|
19
|
-
* The location of the parameter. Possible values are `"query"`, `"header"`, `"path"` or `"cookie"`.
|
|
20
|
-
*/
|
|
21
|
-
in: "path" | "query" | "header" | "cookie";
|
|
22
|
-
/**
|
|
23
|
-
* Determines whether this parameter is mandatory. If the [parameter location](Determines whether this parameter is mandatory.
|
|
24
|
-
* If the parameter location is `"path"`, this property is **REQUIRED** and its value MUST be `true`.
|
|
25
|
-
* Otherwise, the property MAY be included and its default value is false.) is `"path"`, this property is **REQUIRED** and its value MUST be `true`.
|
|
26
|
-
* Otherwise, the property MAY be included and its default value is `false`.
|
|
27
|
-
*/
|
|
28
|
-
required: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* A brief description of the parameter. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.
|
|
31
|
-
*/
|
|
32
|
-
description?: string;
|
|
33
|
-
/**
|
|
34
|
-
* Specifies that a parameter is deprecated and SHOULD be transitioned out of usage.
|
|
35
|
-
*/
|
|
36
|
-
deprecated?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Sets the ability to pass empty-valued parameters.
|
|
39
|
-
* This is valid only for query parameters and allows sending a parameter with an empty value.
|
|
40
|
-
* Default value is `false`.
|
|
41
|
-
* If style is used, and if behavior is `n/a` (cannot be serialized), the value of `allowEmptyValue` SHALL be ignored.
|
|
42
|
-
*/
|
|
43
|
-
allowEmptyValue?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* The schema defining the type used for the parameter.
|
|
46
|
-
*/
|
|
47
|
-
schema?: OS3Schema | OpenSpecRef;
|
|
48
|
-
/**
|
|
49
|
-
* Describes how the parameter value will be serialized depending on the type of the parameter value.
|
|
50
|
-
* Default values (based on value of in): for `query` - `form`; for `path` - `simple`; for `header` - `simple`; for `cookie` - `form`.
|
|
51
|
-
* See [style values](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#style-values).
|
|
52
|
-
*/
|
|
53
|
-
style?: OS3StyleParameter;
|
|
54
|
-
/**
|
|
55
|
-
* When this is true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map.
|
|
56
|
-
* For other types of parameters this property has no effect. When style is form, the default value is true. For all other styles, the default value is false.
|
|
57
|
-
*/
|
|
58
|
-
explode?: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Determines whether the parameter value SHOULD allow reserved characters, as defined by [RFC3986](https://tools.ietf.org/html/rfc3986#section-2.2) `:/?#[]@!$&'()*+,;=` to be included without percent-encoding.
|
|
61
|
-
* This property only applies to parameters with an `in` value of `query`. The default value is `false`.
|
|
62
|
-
*/
|
|
63
|
-
allowReserved?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Example of the media type.
|
|
66
|
-
* The `example` SHOULD match the specified schema and encoding properties if present.
|
|
67
|
-
* The `example` field is mutually exclusive of the `examples` field.
|
|
68
|
-
* Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL override the example provided by the schema.
|
|
69
|
-
* To represent examples of media types that cannot naturally be represented in JSON or YAML, a string value can contain the example with escaping where necessary.
|
|
70
|
-
*/
|
|
71
|
-
example?: any;
|
|
72
|
-
/**
|
|
73
|
-
* Examples of the media type.
|
|
74
|
-
* Each example SHOULD contain a value in the correct format as specified in the parameter encoding.
|
|
75
|
-
* The `examples` field is mutually exclusive of the `example` field.
|
|
76
|
-
* Furthermore, if referencing a `schema` which contains an example, the examples value SHALL override the example provided by the schema.
|
|
77
|
-
*/
|
|
78
|
-
examples?: OpenSpecHash<OS3Example | OpenSpecRef>;
|
|
79
|
-
/***
|
|
80
|
-
* A map containing the representations for the parameter. The key is the media type and the value describes it. The map MUST only contain one entry.
|
|
81
|
-
*/
|
|
82
|
-
content?: OpenSpecHash<OS3MediaType>;
|
|
83
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {OpenSpecPath} from "../common/OpenSpecPath.js";
|
|
2
|
-
import {OpenSpecRef} from "../common/OpenSpecRef.js";
|
|
3
|
-
import {OS3Operation} from "./OS3Operation.js";
|
|
4
|
-
import {OS3Parameter} from "./OS3Parameter.js";
|
|
5
|
-
import {OS3Schema} from "./OS3Schema.js";
|
|
6
|
-
import {OS3Server} from "./OS3Server.js";
|
|
7
|
-
|
|
8
|
-
export interface OS3Paths<Schema = OS3Schema> extends OpenSpecPath<OS3Operation<Schema>> {
|
|
9
|
-
/**
|
|
10
|
-
* An optional, string summary, intended to apply to all operations in this path.
|
|
11
|
-
*/
|
|
12
|
-
summary?: string;
|
|
13
|
-
/**
|
|
14
|
-
* An optional, string description, intended to apply to all operations in this path. CommonMark syntax MAY be used for rich text representation.
|
|
15
|
-
*/
|
|
16
|
-
description?: string;
|
|
17
|
-
/**
|
|
18
|
-
* A definition of a TRACE operation on this path.
|
|
19
|
-
*/
|
|
20
|
-
trace?: OS3Operation<Schema>;
|
|
21
|
-
/**
|
|
22
|
-
* An alternative server array to service all operations in this path.
|
|
23
|
-
*/
|
|
24
|
-
servers?: OS3Server[];
|
|
25
|
-
/**
|
|
26
|
-
* A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location. The list can use the Reference Object to link to parameters that are defined at the OpenAPI Object's components/parameters.
|
|
27
|
-
*/
|
|
28
|
-
parameters?: (OS3Parameter<Schema> | OpenSpecRef)[];
|
|
29
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import {OpenSpecHash} from "../common/OpenSpecHash.js";
|
|
2
|
-
import {OpenSpecRef} from "../common/OpenSpecRef.js";
|
|
3
|
-
import {OS3Example} from "./OS3Example.js";
|
|
4
|
-
import {OS3MediaType} from "./OS3MediaType.js";
|
|
5
|
-
import {OS3Schema} from "./OS3Schema.js";
|
|
6
|
-
|
|
7
|
-
export interface OS3RequestBody<Schema = OS3Schema> {
|
|
8
|
-
/**
|
|
9
|
-
* A brief description of the request body. This could contain examples of use. CommonMark syntax MAY be used for rich text representation.
|
|
10
|
-
*/
|
|
11
|
-
description?: string;
|
|
12
|
-
/**
|
|
13
|
-
* A map containing descriptions of potential request body. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
|
|
14
|
-
*/
|
|
15
|
-
content?: OpenSpecHash<OS3MediaType<Schema>>;
|
|
16
|
-
/**
|
|
17
|
-
* Determines if the request body is required in the request. Defaults to false.
|
|
18
|
-
*/
|
|
19
|
-
required?: boolean;
|
|
20
|
-
|
|
21
|
-
examples?: OpenSpecHash<OS3Example | OpenSpecRef>;
|
|
22
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import {OpenSpecHash} from "../common/OpenSpecHash.js";
|
|
2
|
-
import {OpenSpecRef} from "../common/OpenSpecRef.js";
|
|
3
|
-
import {OS3Header} from "./OS3Header.js";
|
|
4
|
-
import {OS3Link} from "./OS3Link.js";
|
|
5
|
-
import {OS3MediaType} from "./OS3MediaType.js";
|
|
6
|
-
import {OS3Schema} from "./OS3Schema.js";
|
|
7
|
-
|
|
8
|
-
export interface OS3Response<Schema = OS3Schema, Header = OS3Header<Schema>> {
|
|
9
|
-
/**
|
|
10
|
-
* A short description of the response. CommonMark syntax MAY be used for rich text representation.
|
|
11
|
-
*/
|
|
12
|
-
description: string;
|
|
13
|
-
/**
|
|
14
|
-
* Maps a header name to its definition. [RFC7230](https://tools.ietf.org/html/rfc7230#page-22) states header names are case insensitive. If a response header is defined with the name "Content-Type", it SHALL be ignored.
|
|
15
|
-
*/
|
|
16
|
-
headers?: OpenSpecHash<Header>;
|
|
17
|
-
/**
|
|
18
|
-
* A map containing descriptions of potential response payloads. The key is a media type or [media type range](https://tools.ietf.org/html/rfc7231#appendix-D) and the value describes it. For responses that match multiple keys, only the most specific key is applicable. e.g. text/plain overrides text/*
|
|
19
|
-
*/
|
|
20
|
-
content?: OpenSpecHash<OS3MediaType<Schema>>;
|
|
21
|
-
/**
|
|
22
|
-
* A map of operations links that can be followed from the response. The key of the map is a short name for the link, following the naming constraints of the names for [Component Objects](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#componentsObject).
|
|
23
|
-
*/
|
|
24
|
-
links?: OpenSpecHash<OS3Link | OpenSpecRef>;
|
|
25
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js";
|
|
2
|
-
import {OpenSpecBaseJsonSchema, OpenSpecJsonSchema} from "../common/OpenSpecJsonSchema.js";
|
|
3
|
-
import {OpenSpecRef} from "../common/OpenSpecRef.js";
|
|
4
|
-
import {OpenSpecXML} from "../common/OpenSpecXML.js";
|
|
5
|
-
|
|
6
|
-
export interface OS3BaseSchema extends OpenSpecBaseJsonSchema {
|
|
7
|
-
/**
|
|
8
|
-
* Required if type is "array". Describes the type of items in the array.
|
|
9
|
-
*/
|
|
10
|
-
items?: OS3Schema | OpenSpecRef;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface OS3Schema extends OpenSpecJsonSchema<OS3Schema> {
|
|
14
|
-
/**
|
|
15
|
-
* Inline or referenced schema MUST be of a [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#schemaObject) and not a standard JSON Schema.
|
|
16
|
-
*/
|
|
17
|
-
oneOf?: (OS3Schema | OpenSpecRef)[];
|
|
18
|
-
/**
|
|
19
|
-
* Inline or referenced schema MUST be of a [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#schemaObject) and not a standard JSON Schema.
|
|
20
|
-
*/
|
|
21
|
-
anyOf?: (OS3Schema | OpenSpecRef)[];
|
|
22
|
-
/**
|
|
23
|
-
* Inline or referenced schema MUST be of a [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md#schemaObject) and not a standard JSON Schema.
|
|
24
|
-
*/
|
|
25
|
-
not?: OS3Schema | OpenSpecRef;
|
|
26
|
-
/**
|
|
27
|
-
* Allows sending a null value for the defined schema. Default value is false.
|
|
28
|
-
*/
|
|
29
|
-
nullable?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Adds support for polymorphism.
|
|
32
|
-
* The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it.
|
|
33
|
-
*/
|
|
34
|
-
discriminator?: string;
|
|
35
|
-
/**
|
|
36
|
-
* Relevant only for Schema "properties" definitions. Declares the property as "read only". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as readOnly being true SHOULD NOT be in the required list of the defined schema. Default value is false.
|
|
37
|
-
*/
|
|
38
|
-
readOnly?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Relevant only for Schema "properties" definitions. Declares the property as "write only". Therefore, it MAY be sent as part of a request but SHOULD NOT be sent as part of the response. If the property is marked as writeOnly being true and is in the required list, the required will take effect on the request only. A property MUST NOT be marked as both readOnly and writeOnly being true. Default value is false.
|
|
41
|
-
*/
|
|
42
|
-
writeOnly?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.
|
|
45
|
-
*/
|
|
46
|
-
xml?: OpenSpecXML;
|
|
47
|
-
/**
|
|
48
|
-
* Additional external documentation for this schema.
|
|
49
|
-
*/
|
|
50
|
-
externalDocs?: OpenSpecExternalDocs;
|
|
51
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import {OS3Flows} from "./OS3Flows.js";
|
|
2
|
-
|
|
3
|
-
export interface OS3SecurityBase {
|
|
4
|
-
/**
|
|
5
|
-
* The type of the security scheme
|
|
6
|
-
*/
|
|
7
|
-
type: "apiKey" | "oauth2" | "http" | "openIdConnect";
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
description?: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface OS3SecurityApiKey extends OS3SecurityBase {
|
|
15
|
-
/**
|
|
16
|
-
* The type of the security scheme
|
|
17
|
-
*/
|
|
18
|
-
type: "apiKey";
|
|
19
|
-
/**
|
|
20
|
-
* The name of the header, query or cookie parameter to be used.
|
|
21
|
-
*/
|
|
22
|
-
name: string;
|
|
23
|
-
/**
|
|
24
|
-
* The location of the API key. Valid values are `query`, `header` or `cookie`.
|
|
25
|
-
*/
|
|
26
|
-
in: "query" | "header" | "cookie";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface OS3SecurityOAuth2 extends OS3SecurityBase {
|
|
30
|
-
/**
|
|
31
|
-
* The type of the security scheme
|
|
32
|
-
*/
|
|
33
|
-
type: "oauth2";
|
|
34
|
-
/**
|
|
35
|
-
* An object containing configuration information for the flow types supported.
|
|
36
|
-
*/
|
|
37
|
-
flows: OS3Flows;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export interface OS3SecurityOpenIDConnect extends OS3SecurityBase {
|
|
41
|
-
/**
|
|
42
|
-
* The type of the security scheme
|
|
43
|
-
*/
|
|
44
|
-
type: "openIdConnect";
|
|
45
|
-
openIdConnectUrl: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface OS3SecurityHTTP extends OS3SecurityBase {
|
|
49
|
-
/**
|
|
50
|
-
* The type of the security scheme
|
|
51
|
-
*/
|
|
52
|
-
type: "http";
|
|
53
|
-
/**
|
|
54
|
-
* The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC7235](https://tools.ietf.org/html/rfc7235#section-5.1).
|
|
55
|
-
*/
|
|
56
|
-
scheme: string;
|
|
57
|
-
/**
|
|
58
|
-
* A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
|
|
59
|
-
*/
|
|
60
|
-
bearerFormat?: string;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export type OS3Security = OS3SecurityApiKey | OS3SecurityHTTP | OS3SecurityOAuth2 | OS3SecurityOpenIDConnect;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {OpenSpecHash} from "../common/OpenSpecHash.js";
|
|
2
|
-
|
|
3
|
-
export interface OpenSpecServerVariable {
|
|
4
|
-
/**
|
|
5
|
-
* An enumeration of string values to be used if the substitution options are from a limited set.
|
|
6
|
-
*/
|
|
7
|
-
enum?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The default value to use for substitution, and to send, if an alternate value is not supplied. Unlike the Schema Object's default, this value MUST be provided by the consumer.
|
|
10
|
-
*/
|
|
11
|
-
default: string;
|
|
12
|
-
/**
|
|
13
|
-
* An optional description for the server variable. CommonMark syntax MAY be used for rich text representation.
|
|
14
|
-
*/
|
|
15
|
-
description?: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export interface OS3Server {
|
|
19
|
-
/**
|
|
20
|
-
* A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenAPI document is being served. Variable substitutions will be made when a variable is named in `{brackets}`.
|
|
21
|
-
*/
|
|
22
|
-
url: string;
|
|
23
|
-
/**
|
|
24
|
-
* An optional string describing the host designated by the URL. CommonMark syntax MAY be used for rich text representation.
|
|
25
|
-
*/
|
|
26
|
-
description: string;
|
|
27
|
-
/**
|
|
28
|
-
* A map between a variable name and its value. The value is used for substitution in the server's URL template.
|
|
29
|
-
*/
|
|
30
|
-
variables?: OpenSpecHash<OpenSpecServerVariable>;
|
|
31
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {OpenSpecExternalDocs} from "../common/OpenSpecExternalDocs.js";
|
|
2
|
-
import {OpenSpecHash} from "../common/OpenSpecHash.js";
|
|
3
|
-
import {OpenSpecInfo} from "../common/OpenSpecInfo.js";
|
|
4
|
-
import {OpenSpecSecurity} from "../common/OpenSpecSecurity.js";
|
|
5
|
-
import {OpenSpecTag} from "../common/OpenSpecTag.js";
|
|
6
|
-
import {OS3Components} from "./OS3Components.js";
|
|
7
|
-
import {OS3Paths} from "./OS3Paths.js";
|
|
8
|
-
import {OS3Schema} from "./OS3Schema.js";
|
|
9
|
-
import {OS3Server} from "./OS3Server.js";
|
|
10
|
-
|
|
11
|
-
export interface OpenSpec3<Schema = OS3Schema> {
|
|
12
|
-
/**
|
|
13
|
-
* This string MUST be the semantic version number of the OpenAPI Specification version that the OpenAPI document uses. The openapi field SHOULD be used by tooling specifications and clients to interpret the OpenAPI document. This is not related to the API info.version string.
|
|
14
|
-
*/
|
|
15
|
-
openapi: string;
|
|
16
|
-
/**
|
|
17
|
-
* Provides metadata about the API. The metadata MAY be used by tooling as required.
|
|
18
|
-
*/
|
|
19
|
-
info: OpenSpecInfo;
|
|
20
|
-
/**
|
|
21
|
-
* An array of Server Objects, which provide connectivity information to a target server. If the servers property is not provided, or is an empty array, the default value would be a Server Object with a url value of /.
|
|
22
|
-
*/
|
|
23
|
-
servers?: OS3Server[];
|
|
24
|
-
/**
|
|
25
|
-
* The available paths and operations for the API.
|
|
26
|
-
*/
|
|
27
|
-
paths: OpenSpecHash<OS3Paths<Schema>>;
|
|
28
|
-
/**
|
|
29
|
-
* An element to hold various schemas for the specification.
|
|
30
|
-
*/
|
|
31
|
-
components?: OS3Components<Schema>;
|
|
32
|
-
/**
|
|
33
|
-
* A declaration of which security mechanisms can be used across the API. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. Individual operations can override this definition.
|
|
34
|
-
*/
|
|
35
|
-
security?: OpenSpecSecurity;
|
|
36
|
-
/**
|
|
37
|
-
* A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the Operation Object must be declared. The tags that are not declared MAY be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.
|
|
38
|
-
*/
|
|
39
|
-
tags?: OpenSpecTag[];
|
|
40
|
-
/**
|
|
41
|
-
* Additional external documentation.
|
|
42
|
-
*/
|
|
43
|
-
externalDocs?: OpenSpecExternalDocs;
|
|
44
|
-
}
|