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: versions/2.0.md
+25-11Lines changed: 25 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -23,13 +23,27 @@ Version | Date | Notes
23
23
24
24
## Definitions
25
25
26
-
- <aname="pathTemplating"/>Path Templating
27
-
Path templating refers to the usage of curly braces to mark a section of a URL path as replacable using path parameters. **NB: Need to add a more elaborate explanation (limitations, rules and so on)**.
26
+
#####<aname="pathTemplating"/>Path Templating
27
+
Path templating refers to the usage of curly braces ({}) to mark a section of a URL path as replacable using path parameters.
28
28
29
-
- <aname="mimeTypes"/>Mime Types
30
-
**NB: Need to add information about valid mime type structures.****
29
+
#####<aname="mimeTypes"/>Mime Types
30
+
Mime type definitions are spread across several resources. The mime type definitions should be in compliance to the [wikipedia](http://en.wikipedia.org/wiki/Internet_media_type#Naming) definition.
31
31
32
-
- Path
32
+
Some examples of possible mime type definitions:
33
+
```
34
+
text/plain; charset=utf-8
35
+
application/json
36
+
application/vnd.github+json
37
+
application/vnd.github.v3+json
38
+
application/vnd.github.v3.raw+json
39
+
application/vnd.github.v3.text+json
40
+
application/vnd.github.v3.html+json
41
+
application/vnd.github.v3.full+json
42
+
application/vnd.github.v3.diff
43
+
application/vnd.github.v3.patch
44
+
```
45
+
##### <aname="httpCodes"/>HTTP Status Codes
46
+
The HTTP Status Codes are used to indicate the status of the executed operation. The available status codes are described by [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).
33
47
34
48
## Specification
35
49
@@ -90,7 +104,7 @@ Field Name | Type | Description
90
104
---|:---:|---
91
105
<aname="swaggerSwagger"/>swagger | `string` | **Required.** Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be `"2.0"`.
92
106
<aname="swaggerInfo"/>info | [Info Object](#infoObject) | **Required.** Provides metadata about the API. The metadata can be used by the clients if needed.
93
-
<aname="swaggerHost"/>host | `string` | The host serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the `host` is not included, the host serving the documentation is to be used. The `host` does not support [path templating](#pathTemplating).
107
+
<aname="swaggerHost"/>host | `string` | The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the `host` is not included, the host serving the documentation is to be used (incluing the port). The `host` does not support [path templating](#pathTemplating).
94
108
<aname="swaggerBasePath"/>basePath | `string` | The base path on which the API is served, which is relative to the [`host`](#swaggerHost). If it is not included, the API is served directly under the `host`. The value MUST start with a leading slash (`/`). The `basePath` does not support [path templating](#pathTemplating).
95
109
<aname="swaggerSchemes"/>schemes | [`string`] | 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 specification.
96
110
<aname="swaggerConsumes"/>consumes | [`string`] | 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 [Mime Types](#mimeTypes).
@@ -193,7 +207,7 @@ The Paths may be empty, due to [ACL constraints](#securityFiltering).
193
207
194
208
Field Pattern | Type | Description
195
209
---|:---:|---
196
-
<aname="pathsPath"/>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. [Path templating](#pathTemplating) is allowed.
210
+
<aname="pathsPath"/>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is appended to the [`basePath`](#swaggerBasePath) in order to construct the full URL. [Path templating](#pathTemplating) is allowed.
197
211
<aname="pathsExtensions"/>^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.
198
212
199
213
##### Object Example
@@ -237,7 +251,7 @@ Describes a single API operation on a path.
237
251
238
252
Field Name | Type | Description
239
253
---|:---:|---
240
-
<aname="operationTags"/>tags | [`string`] | A list of tags for API documentation control. See [Tags](#tags)for more information.
254
+
<aname="operationTags"/>tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
241
255
<aname="operationSummary"/>summary | `string` | A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
242
256
<aname="operationDescription"/>description | `string` | A verbose explanation of the operation behavior. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.
243
257
<aname="operationExternalDocs"/>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation.
@@ -375,10 +389,9 @@ Field Name | Type | Description
375
389
##### Patterned Fields
376
390
Field Pattern | Type | Description
377
391
---|:---:|---
378
-
<aname="responsesCode"/>### [(*)](#statusCode) | [Response Object](#responseObject) <span>|</span> [Reference Object](#referenceObject) | Any HTTP status code can be used as the propety name (one property per HTTP status code). Describes the expected response for that HTTP status code. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.
392
+
<aname="responsesCode"/>{[HTTP Status Code](#httpCodes)} | [Response Object](#responseObject) <span>|</span> [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the propety name (one property per HTTP status code). Describes the expected response for that HTTP status code. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.
379
393
<aname="parameterExtensions"/>^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.
380
394
381
-
<aname="statusCode"/>**(*)** - Any HTTP status code as described in the [HTTP protocol specification](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html).
382
395
383
396
##### Object Example
384
397
@@ -419,7 +432,7 @@ Allows sharing examples for operation responses.
419
432
##### Patterned Fields
420
433
Field Pattern | Type | Description
421
434
---|:---:|---
422
-
<aname="exampleMimeType"/>{mime type} | Any | The name of the property MUST be a one of the the Operation `produces` values (either implicit or inherited). The value SHOULD be an example of what such a response would look like.
435
+
<aname="exampleMimeType"/>{[mime type](#mimeTypes)} | Any | The name of the property MUST be a one of the the Operation `produces` values (either implicit or inherited). The value SHOULD be an example of what such a response would look like.
423
436
424
437
##### Object Example
425
438
@@ -522,6 +535,7 @@ Other than the JSON Schema subset fields, the following fields may be used for f
522
535
Field Name | Type | Description
523
536
---|:---:|---
524
537
<aname="schemaDiscriminator"/>discriminator | `string` | Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schemas 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.
538
+
<aname="schenaReadOnly"/>readOnly | `boolean` | 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`.
525
539
<aname="schemaXml"/>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.
526
540
<aname="schemaExternalDocs"/>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
527
541
<aname="schemaExample"/>example | Object | A free-form property to include a an example of an instance for this schema.
0 commit comments