Skip to content

Commit aefeb4d

Browse files
committed
Fixed vendor extension around the spec and schema
1 parent 3caa9e2 commit aefeb4d

File tree

2 files changed

+96
-5
lines changed

2 files changed

+96
-5
lines changed

schemas/v2.0/schema.json

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,11 @@
133133
"description": "The email address of the contact person/organization.",
134134
"format": "email"
135135
}
136+
},
137+
"patternProperties": {
138+
"^x-": {
139+
"$ref": "#/definitions/vendorExtension"
140+
}
136141
}
137142
},
138143
"license": {
@@ -151,6 +156,11 @@
151156
"description": "The URL pointing to the license.",
152157
"format": "uri"
153158
}
159+
},
160+
"patternProperties": {
161+
"^x-": {
162+
"$ref": "#/definitions/vendorExtension"
163+
}
154164
}
155165
},
156166
"paths": {
@@ -202,6 +212,11 @@
202212
"type": "string",
203213
"format": "uri"
204214
}
215+
},
216+
"patternProperties": {
217+
"^x-": {
218+
"$ref": "#/definitions/vendorExtension"
219+
}
205220
}
206221
},
207222
"examples": {
@@ -369,7 +384,12 @@
369384
"$ref": "#/definitions/examples"
370385
}
371386
},
372-
"additionalProperties": false
387+
"additionalProperties": false,
388+
"patternProperties": {
389+
"^x-": {
390+
"$ref": "#/definitions/vendorExtension"
391+
}
392+
}
373393
},
374394
"headers": {
375395
"type": "object",
@@ -445,6 +465,11 @@
445465
"description": {
446466
"type": "string"
447467
}
468+
},
469+
"patternProperties": {
470+
"^x-": {
471+
"$ref": "#/definitions/vendorExtension"
472+
}
448473
}
449474
},
450475
"vendorExtension": {
@@ -1123,6 +1148,11 @@
11231148
"multipleOf": {
11241149
"$ref": "#/definitions/multipleOf"
11251150
}
1151+
},
1152+
"patternProperties": {
1153+
"^x-": {
1154+
"$ref": "#/definitions/vendorExtension"
1155+
}
11261156
}
11271157
},
11281158
"security": {
@@ -1163,6 +1193,11 @@
11631193
"type": "boolean",
11641194
"default": false
11651195
}
1196+
},
1197+
"patternProperties": {
1198+
"^x-": {
1199+
"$ref": "#/definitions/vendorExtension"
1200+
}
11661201
}
11671202
},
11681203
"tag": {

versions/2.0.md

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ Field Name | Type | Description
120120
<a name="swaggerTags"></a>tags | [[Tag Object](#tagObject)] | 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](#operationObject) 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.
121121
<a name="swaggerExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation.
122122

123+
##### Patterned Objects
124+
125+
Field Pattern | Type | Description
126+
---|:---:|---
127+
<a name="swaggerExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
123128

124129
#### <a name="infoObject"></a>Info Object
125130

@@ -188,6 +193,12 @@ Field Name | Type | Description
188193
<a name="contactUrl"></a>url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.
189194
<a name="contactEmail"></a>email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.
190195

196+
##### Patterned Objects
197+
198+
Field Pattern | Type | Description
199+
---|:---:|---
200+
<a name="contactExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
201+
191202
##### Contact Object Example:
192203

193204
```js
@@ -215,6 +226,12 @@ Field Name | Type | Description
215226
<a name="licenseName"></a>name | `string` | **Required.** The license name used for the API.
216227
<a name="licenseUrl"></a>url | `string` | A URL to the license used for the API. MUST be in the format of a URL.
217228

229+
##### Patterned Objects
230+
231+
Field Pattern | Type | Description
232+
---|:---:|---
233+
<a name="licenseExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
234+
218235
##### License Object Example:
219236

220237
```js
@@ -519,6 +536,12 @@ Field Name | Type | Description
519536
<a name="externalDocDescription"></a>description | `string` | A short description of the target documentation. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.
520537
<a name="externalDocUrl"></a>url | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.
521538

539+
##### Patterned Objects
540+
541+
Field Pattern | Type | Description
542+
---|:---:|---
543+
<a name="externalDocExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
544+
522545
##### External Documentation Object Example
523546

524547
```js
@@ -765,6 +788,12 @@ Field Name | Type | Description
765788
<a name="itemsEnum"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.
766789
<a name="itemsMultipleOf"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.
767790

791+
##### Patterned Objects
792+
793+
Field Pattern | Type | Description
794+
---|:---:|---
795+
<a name="operationExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
796+
768797
##### Items Object Examples
769798

770799
Items must be of type string and have the minimum length of 2 characters:
@@ -864,7 +893,12 @@ Field Name | Type | Description
864893
<a name="responseSchema"></a>schema | [Schema Object](#schemaObject) | A definition of the response structure. It can be a primitive, an array or an object. If this field does not exist, it means no content is returned as part of the response. As an extension to the [Schema Object](#schemaObject), its root `type` value may also be `"file"`. This SHOULD be accompanied by a relevant `produces` mime-type.
865894
<a name="responseHeaders"></a>headers | [Headers Object](#headersObject) | A list of headers that are sent with the response.
866895
<a name="responseExamples"></a>examples | [Example Object](#exampleObject) | An example of the response message.
867-
<a name="responseExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
896+
897+
##### Patterned Objects
898+
899+
Field Pattern | Type | Description
900+
---|:---:|---
901+
<a name="responseExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
868902

869903
##### Response Object Examples
870904

@@ -967,7 +1001,7 @@ Lists the headers that can be sent as part of a response.
9671001
Field Pattern | Type | Description
9681002
---|:---:|---
9691003
<a name="headersName"></a>{name} | [Header Object](#headerObject) | The name of the property corresponds to the name of the header. The value describes the type of the header.
970-
<a name="headersExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
1004+
9711005
##### Headers Object Example
9721006

9731007
Rate-limit headers:
@@ -1058,6 +1092,12 @@ Field Name | Type | Description
10581092
<a name="headerEnum"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.
10591093
<a name="headerMultipleOf"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.
10601094

1095+
##### Patterned Objects
1096+
1097+
Field Pattern | Type | Description
1098+
---|:---:|---
1099+
<a name="headerExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
1100+
10611101
##### Header Object Example
10621102

10631103
A simple header with of an integer type:
@@ -1194,7 +1234,12 @@ Field Name | Type | Description
11941234
<a name="schemaXml"></a>xml | [XML Object](#xmlObject) | 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.
11951235
<a name="schemaExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
11961236
<a name="schemaExample"></a>example | Any | A free-form property to include a an example of an instance for this schema.
1197-
<a name="schemaExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
1237+
1238+
##### Patterned Objects
1239+
1240+
Field Pattern | Type | Description
1241+
---|:---:|---
1242+
<a name="schemaExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
11981243

11991244
###### Composition and Inheritance (Polymorphism)
12001245

@@ -1535,6 +1580,12 @@ Field Name | Type | Description
15351580
<a name="xmlAttribute"></a>attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.
15361581
<a name="xmlWrapped"></a>wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, `<books><book/><book/></books>`) or unwrapped (`<book/><book/>`). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).
15371582

1583+
##### Patterned Objects
1584+
1585+
Field Pattern | Type | Description
1586+
---|:---:|---
1587+
<a name="operationExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
1588+
15381589
##### XML Object Examples
15391590

15401591
The examples of the XML object definitions are included inside a property definition of a [Schema Object](#schemaObject) with a sample of the XML representation of it.
@@ -1937,7 +1988,6 @@ This does *not* define global operation parameters.
19371988
Field Pattern | Type | Description
19381989
---|:---:|---
19391990
<a name="pdName"></a>{name} | [Parameter Object](#parameterObject) | A single parameter definition, mapping a "name" to the parameter it defines.
1940-
<a name="parametersExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
19411991

19421992
##### Parameters Definition Object Example
19431993

@@ -2151,6 +2201,12 @@ Field Pattern | Type | Description
21512201
---|:---:|---
21522202
<a name="scopesName"></a>{name} | `string` | Maps between a name of a scope to a short description of it (as the value of the property).
21532203

2204+
##### Patterned Objects
2205+
2206+
Field Pattern | Type | Description
2207+
---|:---:|---
2208+
<a name="scopesExtensions"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.
2209+
21542210
##### Scopes Object Example
21552211

21562212
```js

0 commit comments

Comments
 (0)