You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/spec-types/src/json-schema/draft-2020-12/spec.ts
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -30,13 +30,13 @@ export interface Document
30
30
*
31
31
* {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf} can not be used to "extend" a schema to add more details to it in the sense of object-oriented inheritance. {@link https://json-schema.org/learn/glossary#instance Instances} must independently be valid against "all of" the schemas in the `allOf`. See the section on {@link https://json-schema.org/understanding-json-schema/reference/object#extending Extending Closed Schemas} for more information.
32
32
*/
33
-
allOf?: ReadonlyArray<Document>;
33
+
allOf?: Array<Document>;
34
34
/**
35
35
* `anyOf`: (OR) Must be valid against _any_ of the subschemas
36
36
*
37
37
* To validate against `anyOf`, the given data must be valid against any (one or more) of the given subschemas.
38
38
*/
39
-
anyOf?: ReadonlyArray<Document>;
39
+
anyOf?: Array<Document>;
40
40
/**
41
41
* The `const` keyword is used to restrict a value to a single value.
42
42
*/
@@ -62,7 +62,7 @@ export interface Document
62
62
/**
63
63
* The `dependentRequired` {@link https://json-schema.org/learn/glossary#keyword keyword} conditionally requires that certain properties must be present if a given property is present in an object. For example, suppose we have a {@link https://json-schema.org/learn/glossary#schema schema} representing a customer. If you have their credit card number, you also want to ensure you have a billing address. If you don't have their credit card number, a billing address would not be required. We represent this dependency of one property on another using the `dependentRequired` keyword. The value of the `dependentRequired` keyword is an object. Each entry in the object maps from the name of a property, _p_, to an array of strings listing properties that are required if _p_ is present.
* The `dependentSchemas` keyword conditionally applies a {@link https://json-schema.org/learn/glossary#subschema subschema} when a given property is present. This schema is applied in the same way {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf} applies schemas. Nothing is merged or extended. Both schemas apply independently.
68
68
*/
@@ -90,11 +90,11 @@ export interface Document
90
90
*
91
91
* You can use `enum` even without a type, to accept values of different types.
92
92
*/
93
-
enum?: ReadonlyArray<unknown>;
93
+
enum?: Array<unknown>;
94
94
/**
95
95
* The `examples` keyword is a place to provide an array of examples that validate against the schema. This isn't used for validation, but may help with explaining the effect and purpose of the schema to a reader. Each entry should validate against the schema in which it resides, but that isn't strictly required. There is no need to duplicate the `default` value in the `examples` array, since `default` will be treated as another example.
96
96
*/
97
-
examples?: ReadonlyArray<unknown>;
97
+
examples?: Array<unknown>;
98
98
/**
99
99
* The `format` keyword allows for basic semantic identification of certain kinds of string values that are commonly used. For example, because JSON doesn't have a "DateTime" type, dates need to be encoded as strings. `format` allows the schema author to indicate that the string value should be interpreted as a date. By default, `format` is just an annotation and does not effect validation.
100
100
*
@@ -126,7 +126,7 @@ export interface Document
126
126
*
127
127
* Careful consideration should be taken when using `oneOf` entries as the nature of it requires verification of _every_ sub-schema which can lead to increased processing times. Prefer `anyOf` where possible.
128
128
*/
129
-
oneOf?: ReadonlyArray<Document>;
129
+
oneOf?: Array<Document>;
130
130
/**
131
131
* The boolean keywords `readOnly` and `writeOnly` are typically used in an API context. `readOnly` indicates that a value should not be modified. It could be used to indicate that a `PUT` request that changes a value would result in a `400 Bad Request` response. `writeOnly` indicates that a value may be set, but will remain hidden. In could be used to indicate you can set a value with a `PUT` request, but it would not be included when retrieving that record with a `GET` request.
* `prefixItems` is an array, where each item is a schema that corresponds to each index of the document's array. That is, an array where the first element validates the first element of the input array, the second element validates the second element of the input array, etc.
189
189
*/
190
-
prefixItems?: ReadonlyArray<Document>;
190
+
prefixItems?: Array<Document>;
191
191
/**
192
192
* The `unevaluatedItems` keyword is useful mainly when you want to add or disallow extra items to an array.
* The `required` keyword takes an array of zero or more strings. Each of these strings must be unique.
313
313
*/
314
-
required?: ReadonlyArray<string>;
314
+
required?: Array<string>;
315
315
/**
316
316
* The `unevaluatedProperties` keyword is similar to `additionalProperties` except that it can recognize properties declared in subschemas. So, the example from the previous section can be rewritten without the need to redeclare properties.
* You can use `enum` even without a type, to accept values of different types.
24
24
*/
25
-
enum?: ReadonlyArray<unknown>;
25
+
enum?: Array<unknown>;
26
26
/**
27
27
* Ranges of numbers are specified using a combination of the `minimum` and `maximum` keywords, (or `exclusiveMinimum` and `exclusiveMaximum` for expressing exclusive range).
* The `required` keyword takes an array of zero or more strings. Each of these strings must be unique.
130
130
*/
131
-
required?: ReadonlyArray<string>;
131
+
required?: Array<string>;
132
132
/**
133
133
* The `title` and `description` keywords must be strings. A "title" will preferably be short, whereas a "description" will provide a more lengthy explanation about the purpose of the data described by the schema.
Copy file name to clipboardExpand all lines: packages/spec-types/src/openapi/v2/spec.ts
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ export interface Document {
17
17
/**
18
18
* A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}.
19
19
*/
20
-
consumes?: ReadonlyArray<string>;
20
+
consumes?: Array<string>;
21
21
/**
22
22
* An object to hold data types produced and consumed by operations.
23
23
*/
@@ -45,19 +45,19 @@ export interface Document {
45
45
/**
46
46
* A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}.
47
47
*/
48
-
produces?: ReadonlyArray<string>;
48
+
produces?: Array<string>;
49
49
/**
50
50
* An object to hold responses that can be used across operations. This property _does not_ define global responses for all operations.
51
51
*/
52
52
responses?: ResponsesDefinitionsObject;
53
53
/**
54
54
* The transfer protocol of the API. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. If the `schemes` is not included, the default scheme to be used is the one used to access the Swagger definition itself.
* A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.
* Security scheme definitions that can be used across the specification.
63
63
*/
@@ -69,7 +69,7 @@ export interface Document {
69
69
/**
70
70
* 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 {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#operation-object 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.
* See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1}.
221
221
*/
222
-
enum?: ReadonlyArray<unknown>;
222
+
enum?: Array<unknown>;
223
223
/**
224
224
* See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2}.
* See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1}.
403
403
*/
404
-
enum?: ReadonlyArray<unknown>;
404
+
enum?: Array<unknown>;
405
405
/**
406
406
* See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2}.
* A list of MIME types the operation can consume. This overrides the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerConsumes `consumes`} definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}.
536
536
*/
537
-
consumes?: ReadonlyArray<string>;
537
+
consumes?: Array<string>;
538
538
/**
539
539
* Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is `false`.
* A list of parameters that are applicable for this operation. If a parameter is already defined at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#pathItemParameters Path Item}, the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterName name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterIn location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#reference-object Reference Object} to link to parameters that are defined at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerParameters Swagger Object's parameters}. There can be one "body" parameter at most.
* A list of MIME types the operation can produce. This overrides the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerProduces `produces`} definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#mime-types Mime Types}.
560
560
*/
561
-
produces?: ReadonlyArray<string>;
561
+
produces?: Array<string>;
562
562
/**
563
563
* **Required**. The list of possible responses as they are returned from executing this operation.
564
564
*/
565
565
responses: ResponsesObject;
566
566
/**
567
567
* The transfer protocol for the operation. Values MUST be from the list: `"http"`, `"https"`, `"ws"`, `"wss"`. The value overrides the Swagger Object {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerSchemes `schemes`} definition.
* A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerSecurity `security`}. To remove a top-level security declaration, an empty array can be used.
@@ -739,7 +739,7 @@ export type ParameterObject = EnumExtensions &
739
739
/**
740
740
* See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1}.
741
741
*/
742
-
enum?: ReadonlyArray<unknown>;
742
+
enum?: Array<unknown>;
743
743
/**
744
744
* See {@link https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2 https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.1.2}.
* 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 {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterName name} and {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#parameterIn location}. The list can use the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#reference-object Reference Object} to link to parameters that are defined at the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#swaggerParameters Swagger Object's parameters}. There can be one "body" parameter at most.
* {@link https://json-schema.org/understanding-json-schema/reference/combining#allof allOf} can not be used to "extend" a schema to add more details to it in the sense of object-oriented inheritance. {@link https://json-schema.org/learn/glossary#instance Instances} must independently be valid against "all of" the schemas in the `allOf`. See the section on {@link https://json-schema.org/understanding-json-schema/reference/object#extending Extending Closed Schemas} for more information.
1328
1328
*/
1329
-
allOf?: ReadonlyArray<SchemaObject>;
1329
+
allOf?: Array<SchemaObject>;
1330
1330
/**
1331
1331
* Adds support for polymorphism. 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.
* Each name must correspond to a security scheme which is declared in the {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#securityDefinitions Security Definitions}. If the security scheme is of type `"oauth2"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.
0 commit comments