-
Notifications
You must be signed in to change notification settings - Fork 0
1.2) Rest
Thomas Lapierre edited this page Jun 29, 2021
·
17 revisions
Warning:
The documentation of "Objet" and "Rest" is not up to date! It is currently being changed. Please refer to the examples or the Java class diagram.
- Rest object
- Info object
- Path object
- Method object
- Response object
- Schema object
- Parameter object
- Tag object
- ExternalDocs object
| Field Name | Type | Required | Description |
|---|---|---|---|
<info> |
Info object | true | Provides metadata about the API. The metadata can be used by the clients if needed. |
<basePath> |
String | false | The base path on which the API is served, which is relative to the host. If it is not included, the API is served directly under the host. The value MUST start with a leading slash (/). |
<host> |
String | false | 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 (including the port). |
<tags> |
[Tag object] | false | 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. 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. |
<paths> |
[Path object] | true | The available paths and operations for the API. |
<schemes> |
[String] | false | Possible values are : "http", "https", "ws", "wss" |
<rest>
<info>...</info>
<basePath>...</basePath>
<host>...</host>
<tags>...</tags>
<paths>...</paths>
<schemes>
<scheme>...</scheme>
<scheme>...</scheme>
...
</schemes>
</rest>
| Field Name | Type | Required | Description |
|---|---|---|---|
<description> |
String | false | A short description of the application. |
<version> |
String | true | Provides the version of the application API (not to be confused with the specification version) |
<title> |
String | true | The title of the application. |
<contact-name> |
String | false | The contact name for the exposed API. |
<contact-email> |
String | false | The contact email for the exposed API. |
<contact-url> |
String | false | The contact url for the exposed API. |
<licence-name> |
String | true if licence-url is defined | The licence name for the exposed API. |
<licence-url> |
String | false | The licence url for the exposed API. |
<terms-of-service> |
String | false | The Terms of Service for the API. |
<info>
<description>...</description>
<version>...</version>
<title>...</title>
<contact-name>...</contact-name>
<contact-email>...</contact-email>
<contact-url>...</contact-url>
<licence-name>...</contact-name>
<licence-url>...</licence-url>
<terms-of-service>...</terms-of-service>
</info>
| Field Name | Type | Required | Description |
|---|---|---|---|
<name> |
String | true | A relative path to an individual endpoint. The field name MUST begin with a slash. |
<methods> |
[Method object] | true | Description of the different methods |
<path>
<name>...</name>
<methods>...</methods>
</path>
| Field Name | Type | Required | Description |
|---|---|---|---|
<type> |
String | true | Type of the method. Possible values : get, put, post, delete, options, head, patch. |
<tags> |
[String] | false | List of tags in order to group operations. The tags must refer to those declared in the <tags> of the Rest Object |
<operation-id> |
String | false | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. |
<produces> |
[String] | false | A list of MIME types the operation can produce. |
<parameters> |
[Parameter object ] | false | A list of parameters that are applicable for this operation. |
<responses> |
[Response object] | true | The list of possible responses as they are returned from executing this operation. |
<summary> |
String | false | A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters. |
<deprecated> |
Boolean | false | Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is false. |
<description> |
String | false | A verbose explanation of the operation behavior. |
<consumes> |
[String] | false | A list of MIME types the operation can consume. |
<method>
<type>...</type>
<tags>
<tag>...</tag>
<tag>...</tag>
</tags>
<operation-id>...</operation-id>
<produces>...</produces>
<parameters>...</parameters>
<responses>...</responses>
<summary>...</summary>
<deprecated>...</deprecated>
<description>...</description>
<consumes>...</consumes>
</method>
| Field Name | Type | Required | Description |
|---|---|---|---|
<name> |
String | true | Name response. Possible values : "default" or HTTP Status Code |
<description> |
String | true | A short description of the response. |
<schema> |
Schema object | false | 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. |
<response>
<name>...</name>
<description>...</description>
<schema>...</schema>
</response>
| Field Name | Type | Required | Description |
|---|---|---|---|
<ref> |
String | true | The ref tag should contains the name of the object refered. This object should be declared in the objects definition tag. |
<schema>
<ref>...</ref>
</schema>
| Field Name | Type | Required | Description |
|---|---|---|---|
<in> |
String | true | The location of the parameter. Possible values are "query", "header", "path", "formData" or "body". If <in> = "path", the name field MUST correspond to the associated path segment from the path field in the Paths Object. See Path Templating for further information. For all other cases, the name corresponds to the parameter name used based on the in property. |
<name> |
String | true | The name of the parameter. Parameter names are case sensitive. |
<required> |
Boolean | true if <in> = "path" |
Determines whether this parameter is mandatory. If the parameter is in "path", this property is required and its value MUST be true. Otherwise, the property MAY be included and its default value is false. |
<schema> |
Schema object | true if <in> is equal to "body" |
The schema defining the type used for the body parameter. |
<type> |
Data type or "file" | true if <in> is any value other than "body" |
The type of the parameter. Since the parameter is not located at the request body, it is limited to simple types (that is, not an object). If type is "file", the consumes MUST be either "multipart/form-data", " application/x-www-form-urlencoded" or both and the parameter MUST be in "formData". |
<description> |
String | false | A brief description of the parameter. This could contain examples of use. |
<parameter>
<in>...</in>
<name>...</name>
<required>...</required>
<schema>...</schema>
<type>...</type>
<description>...</description>
</parameter>
| Field Name | Type | Required | Description |
|---|---|---|---|
<name> |
String | true | The name of the tag. |
<description> |
String | false | A short description for the tag. |
<external-docs> |
ExternalDocs object | false | Additional external documentation for this tag. |
<tag>
<name>...</name>
<description>...</description>
<external-docs>...</external-docs>
</tag>
| Field Name | Type | Required | Description |
|---|---|---|---|
<description> |
String | false | A short description of the target documentation. |
<url> |
String | true | The URL for the target documentation. Value MUST be in the format of a URL. |
<external-docs>
<description>...</description>
<url>...</url>
</external-docs>
Edited by Thomas Lapierre, 2021