This page lists all supported Swagger 2 elements and rules.

Supported REST Service Elements And Rules

Services are defined using the following elements:

ElementSupported
by
Connector
DescriptionMore Information at ...
swagger (tick)Specifies the Swagger specification version being used. The importer only supports Swagger 2.0.
info(tick)Provides metadata about the API.

title(tick)The title is used as name for the REST interface.
description(tick)The description is used as documentation for the REST interface.
host(tick)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, though. host and port are set in the REST alias.
basePath(tick)The base path on which the API is served. basePath is relative to the host. If it is not included, the API is served directly under host. The basePath is set in the REST alias.
schemes(tick)

A list of transfer protocols of the API. The first scheme is set as protocol in the REST alias.

The REST adapter only supports HTTP and HTTPS.


consumes(error)

A list of MIME types the APIs can consume.

The REST adapter only parses JSON and XML.


produces(error)

A list of MIME types the APIs can produce.

The REST adapter only parses JSON and XML .


paths(tick)The available paths and operations for the API. REST resource classes are created to reproduce each paths structure.

$ref(error)Allows for an external definition of this path item.
methods(tick)The http methods defined for this path. A REST operation is created for each methods.

tags(tick)A list of tags for API documentation control. A usage is created from the operation to the corresponding RESTOperationTag for each tag.
summary(tick)A short summary of what the operation does. If the description if empty, the summary is used as documentation for the operation.
description(tick)A verbose explanation of the operation behavior. The description is used as documentation for the operation.
externalDocs(error)Additional external documentation for this operation.
operationId(error)Unique string used to identify the operation.
consumes(tick)A list of MIME types the operation can consume. As the REST adapter only support JSON and XML if consumes is defined and none of these are in the list the parameters are ignored.
produces (tick)A list of MIME types the operation can produce. As the REST adapter only support JSON and XML if produces is defined and none of these are in the list the responses are ignored.
parameters(tick)A list of parameters of parameter reference that are applicable for this operation. A REST parameter is created for each parameter object.Parameter Object
responses
(tick)The list of possible responses as they are returned from executing this operation. An output parameter is created for the default response status code (201 for POST, 200 for the others). If the status code is < 400 or default, the RESTResponse stereotype is added to the class. If the status code is >= 400 or default the RESTError stereotype is added to the class.
description(tick)A short description of the response. The description is used as a documentation for the parameter or the usage.
schema(tick)

A definition or definition reference of the response structure.

The adapter does not support primitives as response therefore a responses of these types are ignored.

Schema Object
headers(error)A list of headers that are sent with the response.
examples(error)An example of the response message.

schemes (error)The transfer protocol for the operation.
deprecated (error)Declares this operation to be deprecated. 
security (error)A declaration of which security schemes are applied to this operation.
parameters(error)A list of parameters that are applicable to all the operations described under this path.
definitions(tick)A list to hold data types produced and consumed by operations. A class is created for each schema object.Schema Object
parameters(tick)A list to hold parameters that can be used across operations.Parameter Object
responses(error)An list to hold responses that can be used across operations.
securityDefinitions(error)Security scheme definitions that can be used across the specification.
security(error)A declaration of which security schemes are applied for the API as a whole.
tags(tick)A list of tags used by the specification with additional metadata. A RESTOperationTag class is created for each tag definition.

name(tick)The name of the tag is used as name for the class.
description(tick)A short description for the tag. The description is used as documentation for the operation.
externalDocs(tick)Additional external documentation for this tag. The external documentation is set to the tagged values of the RESTOperationTag.
externalDocs(error)Additional external documentation. 

Supported REST Parameter Elements And Rules

Parameter objects can be defined inline or be a reference to a parameter of the parameters list.

Element

Supported
By
Connector
DescriptionMore Information at ...
name(tick)The name of the parameter. Parameter names are case sensitive.
  • If in is "path", the name field must correspond to the associated path segment from the path.
  • For all other cases, the name corresponds to the parameter name based on the in property.
See Path Templating for further information.
in((tick))

The location of the parameter. Possible values are "query", "header", "path" or "body".

"formData" is not supported by the importer and ignored.


description(error)A brief description of the parameter
required(tick)Determines whether this parameter is mandatory. If true, the multiplicity of the parameter is set to 1, else it is set to 0..1.
schema(tick)If in is "body", schema defines the type used for the body parameter.Schema Object
type(tick)

if in is other than "body", type defines the type of the parameter.

  • integer: the base type Integer is used.
  • number: the base type Float is used.
  • boolean: the base type Boolean is used.
  • string: the type depends on the format.
    • byte: the base type Blob is used.
    • date-time: the base type DateTime is used.
    • otherwise the base type String is used.
  • array: the parameter will get the E2EArray stereotype and the class of items is used as arrayElement.

If type is not given at all, and the definition has no properties, it will be imported as urn:Base Types.Any.


format(tick) The format of the object is used to be more specific when the type is string.
items(tick) The item is a schema object to define the type of element in the array. Only used if type is array.  Schema Object

Supported REST Schema Elements And Rules

Schema objects can be defined inline or be a reference to an object of the definitions list. The following rules apply for schema objects:

  • A class is created for each schema object that is not a base type or array.
  • If the schema object is in the definitions list, the key is used as class name.
  • In all other cases, a unique name is created using the path to the schema object (E.g.: "UserList_Items", "users_GET_response" ...).
ElementSupported
By Connector
DescriptionMore Information at ...
$ref(tick)A reference to a schema defined in the definitions list. the schema object is replaced by the definition.
type(tick)

The type of the object.

  • integer: base type Integer is used.
  • number: base type Float is used.
  • boolean: base type Boolean is used.
  • string: type depends on the format.
    • byte: base type Blob is used.
    • date-time: base type DateTime is used.
    • otherwise base type String is used.
  • array: if used as type of a parameter the parameter will get the E2EArray stereotype and the class of items is used as arrayElement. If used as type of a property, the class of items is used and the multiplicity is set to 0..*.
  • object: A class is created and properties are created regarding the allOf and properties values.

If type is not given at all, and the definition has no properties, it will be imported as urn:Base Types.Any.


format(tick)The format of the object is used to be more specific when the type is string.
items(tick)The item is a schema object to defined the type of element in the array. Only used if type is array.
allOf(tick)List of schema object. The resulting class will contain all properties of all listed schema objects.
properties(tick)List of properties. Each property is define by a name and a schema object. A property is created on the resulting class for each properties defined.
additionalProperties(error)This should allow to define a map/dictionary.
xml(error)Adds additional metadata to describe the XML representation format of this property.
On this Page:
Related Documentation:
  • No labels