REST APIStereotype REST API is to used define a REST API for a Designer service. Multiexcerpt |
---|
MultiExcerptName | RESTAPI |
---|
shouldDisplayInlineCommentsInIncludes | false |
---|
| Tagged Value | Description | Allowed Values |
---|
port | Defines the machine port number the service is binding to. | any number Using ports below 1024 may require additional privileges. | tracePort | Defines the shadow port of the service used for tracing. | any number (default is service port + 40000) | maxRequestBodySize | Multiexcerpt include |
---|
SpaceWithExcerpt | INTERNAL |
---|
MultiExcerptName | maxrequestbodysize |
---|
PageWithExcerpt | INTERNAL:_designer_excerpts |
---|
shouldDisplayInlineCommentsInIncludes | false |
---|
|
| any positive integer | 0 | Accept unlimited requests (default of services compiled with Builder versions < 7.12.0). | 2048 | 2MB, default if not specified | maxRequestHeaderSize | Multiexcerpt include |
---|
SpaceWithExcerpt | INTERNAL |
---|
MultiExcerptName | maxrequestheadersize |
---|
PageWithExcerpt | INTERNAL:_designer_excerpts |
---|
shouldDisplayInlineCommentsInIncludes | false |
---|
|
| any positive integer | 8 | 8 KB (default if not specified). | maxParallelConnections | Defines the maximum number of request that can be processed in parallel. | any positive integer | tokenType | Mark the service as to use token authorization. The REST Test Tool (API Management) will then present a field to enter the token and put the value into the HTTP headers. Refer also to tokenHeaderName for more information. You can use both in a REST service: basic authorization and token authorization, see useBasicAuth. | none | Do not use token authorization. | API Key | Use API key authorization. | tokenHeaderName | Defines the name of the header that will transport the token. This tagged value is only relevant, if token authorization is enabled at all. The token header name will be presented as the name of the header field that can be entered in the Bridge REST Test Tool. Refer also to tokenType for more information. | A valid HTTP header name (according to RFC2616/RFC7230). | useBasicAuth | Mark the service as to use basic authentication mechanisms. The REST Test Tool (API Management) will then present fields to enter the credentials and put the values into the HTTP headers. You can use both in a REST service: basic authorization and token authorization, see tokeType and tokenHeaderName. | true | Enable basic authentication. | false | Disable basic authentication (default). | jsonKeepNulls | Multiexcerpt |
---|
MultiExcerptName | jsonKeepNulls |
---|
| When jsonKeepNulls is true, attributes of the REST response object having NULL values will be rendered to the REST response, otherwise they will be left out completely (see also chapter NULL Values). |
| true | Render attributes with NULL values to the REST response. | false | Leave out attributes with NULL values in the REST response (default). | jsonCompact | Multiexcerpt |
---|
MultiExcerptName | jsonCompact |
---|
| When jsonCompact is true, the JSON composer will generate compact JSON, otherwise it will generate pretty JSON. |
| true | Generate compact JSON (default). | false | Generate pretty JSON. | jsonWriteTypeDiscriminator | Multiexcerpt |
---|
MultiExcerptName | jsonWriteTypeDiscriminator |
---|
| If jsonCompact is true, the JSON composer will generate xUML type properties ("e2e:type") to the generated JSON. If this option is true, the Runtime will write the original xUML type to the generated JSON in form of "e2e:type": "<name of the original xUML type>" if the type being serialized does not match the expected metadata. This is necessary if you want to convert the generated JSON back to an xUML class using jsonToClass(). |
| true | Write xUML type discriminator. | false | Do not write xUML type discriminator. | |
REST PortStereotype REST Port is used on a class to mark it as REST port, the root element of a REST service structure. Multiexcerpt |
---|
MultiExcerptName | RESTPort |
---|
shouldDisplayInlineCommentsInIncludes | false |
---|
| Tagged Value | Description | Allowed Values |
---|
path | Defines the path to this rest interface. If empty, the path is derived from the package structure. | none | path of the package structure will be used, e.g. /API/SupportCase/SupportAPI | any valid path string | path string starting with "/", e.g. /support | errorClass | Assigns a user-defined RESTError class to the REST interface. This class should be set in case of error and given back via the REST response. For more information on REST error classes, see RESTError. | any complex type describing the structure of the error | apiVersion | Defines the API version this port type provides (for documentation purposes only). | any string | |
REST ResourceStereotype REST Resource is used on a class to mark it as REST resource, part of a REST service structure. Multiexcerpt |
---|
MultiExcerptName | RESTResource |
---|
| Attribute (Name of Setting) | Description | Allowed Values |
---|
Relative Path (relativePath) | Defines the path of the REST resource or collection in relation to the parent resource. You can provide a static path, or a dynamic path using the notation : <name of a REST Parameter>. You may also provide a combination of both. | none | the name of the REST resource will be used, e.g. /supportcases | any valid string | the given name will be used | a dynamic path supplying a REST parameter | dynamic path, the value of the REST parameter will be passed to the REST methods, e.g. :id | Is Verbatim Path (isVerbatimPath)
| Multiexcerpt include |
---|
SpaceWithExcerpt | INTERNAL |
---|
MultiExcerptName | isVerbatimPath |
---|
PageWithExcerpt | INTERNAL:_designer_excerpts_stereotypes |
---|
shouldDisplayInlineCommentsInIncludes | false |
---|
|
| true | Path should be treated as verbatim, path normalization is disabled. | false (default) | Path should be URL encoded. | |
RESTStereotype REST is used on a REST resource class method to mark it as REST method, part of a REST service structure. If the method name is one of GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS (with optional trailing '/'), it will be invoked automatically on its parent resource when an corresponding request is received. Refer Implementing REST Methods to for more details and some examples. Multiexcerpt |
---|
| Attribute (Name of Setting) | Description | Allowed Values |
---|
Http Method (httpMethod) | Provide the HTTP method of this REST method should respond to. | a valid HTTP method | GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS | none | - method name, if it is one of: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS (with optional trailing '/')
- GET otherwise
| Relative Path (relativePath) | Defines the path of the REST method in relation to the parent resource. | none | The name of the REST method will be used. | any valid string | The given name will be used. The relative path may also contain variables (REST path parameters, specified as :<variable name>) and can be segmented like e.g. /date=:<a date variable> . | Is Verbatim Path (isVerbatimPath) | Multiexcerpt include |
---|
SpaceWithExcerpt | INTERNAL |
---|
MultiExcerptName | isVerbatimPath |
---|
PageWithExcerpt | INTERNAL:_designer_excerpts_stereotypes |
---|
shouldDisplayInlineCommentsInIncludes | false |
---|
|
| true | Path should be treated as verbatim, path normalization is disabled. | false (default) | Path should be URL encoded. | Blob Body Content Type (blobBodyContentType) | Specify a content type for Blob response parameters from this endpoint. This must be a valid "accept" header as defined in RFC 7231. Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples.
Info |
---|
This attribute must be left unset if no Blob output parameters are used. In future versions, the effect of this attribute may be extended to other contexts as well.
|
| a list of valid media ranges | e.g. image/png Default is application/octet-stream if not specified. | Reject Other Response Content Types (rejectOtherResponseContentTypes)
| The xUML Runtime performs a verification of the "accept" header for REST responses. Specify whether to return an error (HTTP 406, not acceptable) on requests with an "accept" header that does not conform with the content types specified in Blob Body Content Type. Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples.
| true | - Reject calls to the endpoint if the "accept" header does not match the values listed in Blob Body Content Type (default).
- Exception:
HTTP 406 (Not acceptable)
This exception can be suppressed by setting Ignore Http Errors to true on the REST adapter alias.
| false | Accept the request in spite of the mismatch and handle this within the service. | Accepted Request Content Types (acceptedRequestContentType)
| Provide a list of content types this REST endpoint accepts. This must be a list of valid "accept" headers as defined in RFC 7231. Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples. Info |
---|
This attribute must be left unset if no Blob output parameters are used. In future versions, the effect of this attribute may be extended to other contexts as well.
|
| a list of valid media ranges | e.g. image/png;image/jpeg Default is application/octet-stream if not specified. | Reject Other Request Content Types (rejectOtherRequestContentTypes)
| Specify whether to return an error on requests with a content type that does not conform with the content types specified in Accepted Request Content Type. Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples. | true | - Reject calls to this endpoint if the "content-type" header does not match the values listed in Accepted Request Content Type (default).
- Exception:
HTTP 415 (Unsupported Media Type)
This exception can be suppressed by setting Ignore Http Errors to true on the REST adapter alias.
| false | Perform the adapter call in spite of the "content-type" header mismatch and handle this within the service. | |
Anchor |
---|
| rest_parameter |
---|
| rest_parameter |
---|
| REST ParameterStereotype REST Parameter is used on a REST method parameter to mark it as REST parameter. Refer to REST Parameters to for more details and some examples. Multiexcerpt |
---|
MultiExcerptName | RESTParameter |
---|
| Tagged Value | Description | Allowed Values | Allowed REST Methods | Allowed Types | Hints and Limitations |
---|
In (in) | Defines how the parameter will be passed to the REST method. This tag is mandatory. | query | via a query string | all | all simple types and Array of simple type | Unknown parameters will be ignored, known will be passed to the method after being URL-decoded. | path | via the REST resource path | all | Integer, Float, String, Boolean, DateTime | Path parameters are all required. All path parameters must be consumed by the called method and the parameter names must be the same as the path segment identifiers (without colon). | body | via the REST call body | POST, PUT, PATCH | a complex type and Array | A REST method can have only one body parameter. | header | via the REST call header | all | all simple types and Array of simple type | Unknown parameters will be ignored, known will be passed to the method. | External Name (externalName) | Defines an external name for the REST parameter | any string | Use this, when wanting to access a REST service that has parameter names with special characters. In this case, set this name (e.g. ugly@parameter-name ) to externalName and give a better name. So you will not have to escape the parameter every time you use it. | |
REST Error Multiexcerpt |
---|
MultiExcerptName | RESTError |
---|
| Stereotype REST Error is used on a class to mark it as REST error class. Assign such a class to the REST port (see REST Port) and this class will be used as output in case of error. Each REST port can have its separate error class. You can report errors back to the caller using something like: Code Block |
---|
local response = getRestHttpResponse();
response.responseObject = <my error object>;
response.httpStatus = <a matching http error code>; |
|
|