Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 23.1a

...

Multiexcerpt
MultiExcerptNameREST_Service

<<E2ERESTService>>

Stereotype <<E2ERESTService>> is used in the component diagram to mark a service as REST service.

Multiexcerpt
MultiExcerptNameE2ERESTService
Tagged ValueDescriptionAllowed Values

Port
(port)

Defines the machine port number the service is binding to. This port number can be given at service level only.any number
Using ports below 1024 may require additional privileges.
Trace Port
(tracePort)
Defines the shadow port of the service used for tracing.any number (default is service port + 40000)
Max Request Body Size
(maxRequestBodySize)

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNamemax_request_body_size
PageWithExcerptINTERNAL:_bridge_excerpts

any positive integer
0

Accept unlimited requests (default of services compiled with Builder versions < 7.12.0).

2048Builder 7.12.0 2MB, default if not specified
Max Request Header Size
(maxRequestHeaderSize)

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNamemax_request_header_size
PageWithExcerptINTERNAL:_bridge_excerpts

any positive integer
88 KB (default if not specified).
Http Header Roles
(httpHeaderRoles)

Runtime 2020.12 Builder 7.12.0 Assign roles to dedicated incoming headers  that define how the related header will be treated by the xUML Runtime. These definitions overwrite the default behavior (see REST Adapter > HTTP Headers), and X-Transaction-Id, X-Request-Id, X-Sender-Host and/or X-Sender-Service will be substituted by this definition. Refer to HTTP Header Support > Overwriting the Standard HTTP Headers for more details.

Http Header Roles can hold a list of definitions in format <http header name>:<role>, where <role> can be one of the listed allowed values (one list entry per line).

client_host

Take the sender host from header <http header name> instead of X-Sender-Host.

client_service

Take the sender service from header <http header name> instead of X-Sender-Service.

correlation_id

Take the correlation ID from header <http header name> instead of X-Request-Id.

transaction_id

Take the transaction ID from header <http header name> instead of X-Transaction-Id.
Token Type
(tokenType)

Mark the service as to use token authorization. The Bridge REST Test Tool 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.

noneDo not use token authorization.
API KeyUse API key authorization.
Token Header Name
(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).
Use Basic Auth
(useBasicAuth)

Mark the service as to use basic authentication mechanisms. The Bridge REST Test Tool 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.

trueEnable basic authentication.
falseDisable basic authentication (default).
Json Keep Nulls
(jsonKeepNulls)
Multiexcerpt
MultiExcerptNamejsonKeepNulls

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).

trueRender attributes with NULL values to the REST response.
falseLeave out attributes with NULL values in the REST response (default).
Json Compact
(jsonCompact)
Multiexcerpt
MultiExcerptNamejsonCompact

When jsonCompact is true, the JSON composer will generate compact JSON, otherwise it will generate pretty JSON. jsonCompact defaults to true - also on re-compile of an older model with Builder as of 7.0.0-beta3.

trueGenerate compact JSON (default).
falseGenerate pretty JSON.
Json Write Type Discriminator
(jsonWriteTypeDiscriminator)
Multiexcerpt
MultiExcerptNamejsonWriteTypeDiscriminator

Runtime 2021.6 Builder 7.15.0 When 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().

Runtime versions before 2021.6 will ignore the value.

trueWrite xUML type discriminator.
falseDo not write xUML type discriminator.

<<E2ERESTPortType>>

Stereotype <<E2ERESTPortType>> is used on a class to mark it as REST port type, the root element of a REST service structure.

Multiexcerpt
MultiExcerptNameE2ERESTPortType
Tagged ValueDescriptionAllowed Values
Path
(path)
Defines the path to this rest interface. If empty, the path is derived from the package structure.nonepath of the package structure will be used, e.g. /Services/SupportCase/SupportAPI
any valid path stringpath string starting with "/", e.g. /support
Error Class
(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.any complex type describing the structure of the error
Api Version
(apiVersion)
Defines the API version this port type provides (for documentation purposes only).any string

For more information on REST error classes, see <<RESTError>>.

<<RESTResource>>

Stereotype <<RESTResource>> is used on a class to mark it as REST resource, part of a REST service structure.

Multiexcerpt
MultiExcerptNameRESTResource
Tagged ValueDescriptionAllowed 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.nonethe name of the REST resource will be used, e.g. /supportcases
any valid stringthe given name will be used
a dynamic path supplying a REST parameterdynamic path, the value of the REST parameter will be passed to the REST methods, e.g. :id

<<REST>>

Stereotype <<REST>> is used on a <<RESTResource>> class method to mark it as REST method, part of a REST service structure.

Multiexcerpt
MultiExcerptNamenote_RESTOperation
Info
iconfalse

<<REST>> is the stereotype to apply to a REST method. Do not confuse with <<RESTOperation>>, which is used for RESTful HTTP services as described on RESTful HTTP Service.
The latter approach is recommended only, if you want to use content types different to JSON and XML.

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
MultiExcerptNameREST
Tagged ValueDescriptionAllowed Values
Http Method
(httpMethod)
Multiexcerpt
MultiExcerptNamehttpMethod

Provide the HTTP method of this REST method should respond to.

a valid HTTP methodGET, 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)
Multiexcerpt
MultiExcerptNamerelativePath

Defines the path of the REST method in relation to the parent resource.

noneThe name of the REST method will be used.
any valid stringThe 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)
This a REST Adapter setting and has no effect on REST service.
Blob Body Content Type
(blobBodyContentType)
Multiexcerpt
MultiExcerptNameblobBodyContentType

Specify a default content type for Blob response parameters from this endpoint. This must be a list of valid media ranges as defined in RFC 7231.
This information will be generated to the OpenAPI descriptor file (response content type). Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples.

Info
iconfalse

This tag must be left unset if no Blob output parameters are used. In future versions, the effect of this tag may be extended to other contexts as well.

a list of valid media rangese.g. application/msexcel
Default is application/octet-stream if not specified.
Reject Other Response Content Type
(rejectOtherResponseContentTypes)
Multiexcerpt
MultiExcerptNamerejectOtherResponseContentTypes

Runtime 2021.6 Builder 7.15.0 The xUML Runtime performs a verification of the content-type header for REST responses. Specify whether to return an error (HTTP 406, not acceptable) on responses with a content type that does not conform with the content types specified in Blob Body Content Type.

Any mismatch will be logged to the service log on log level Debug. Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples.

true
  • Return HTTP 406 (Not Acceptable, default).
  • Service log: RESTLM/47: Client does not accept any of declared response content types
    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
false
  • Do not return an error.
  • Service log (Debug): RESTLM/10: Cannot generate any of the expected output formats
Accepted Request Content Type
(acceptedRequestContentType)
Multiexcerpt
MultiExcerptNameacceptedRequestContentType

Runtime 2021.6 Builder 7.15.0 Provide a list of content types this REST endpoint accepts. This must be a list of valid media ranges as defined in RFC 7231.
This information will be generated to the OpenAPI descriptor file (parameter content type). Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples.

Info
iconfalse

This tag must be left unset if no Blob output parameters are used. In future versions, the effect of this tag may be extended to other contexts as well.

a list of valid media ranges

e.g. application/xhtml+xml
Default is application/octet-stream if not specified.

Reject Other Request Content Types
(rejectOtherRequestContentTypes)
Multiexcerpt
MultiExcerptNamerejectOtherRequestContentTypes

Runtime 2021.6 Builder 7.15.0 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.

Any mismatch will be logged to the service log on log level Debug. Refer to Handling Blobs in the REST Interface for a deeper explanation and some examples.

true
  • Return HTTP 415 (Unsupported Media Type ) if the request content type of a Blob input parameter does not match the requirements (default).
  • Service log (Debug): RESTLM/10: Cannot generate any of the expected output formats
    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
false
  • Do not return an error.
  • Service log: RESTLM/48: Request content type not declared as accepted by the service

Anchor
rest_parameter
rest_parameter
<<RESTParameter>>

Stereotype <<RESTParameter>> 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
MultiExcerptNameRESTParameter
Tagged ValueDescriptionAllowed ValuesAllowed REST MethodsAllowed TypesHints and Limitations
External Name
(externalName)
Defines an external name for the REST parameterany stringUse 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.
In
(in)
Defines how the parameter will be passed to the REST method. This tag is mandatory.queryvia a query stringallall simple types and Array of simple typeUnknown parameters will be ignored, known will be passed to the method after being URL-decoded.
pathvia the REST resource pathallInteger, Float, String, Boolean, DateTimePath 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).
bodyvia the REST call bodyPOST, PUT, PATCHa complex type and ArrayA REST method can have only one body parameter.
headervia the REST call headerallall simple types and Array of simple typeUnknown parameters will be ignored, known will be passed to the method.
Multiplicity
(multiplicity)
Defines whether the parameter is required, or not.0..1

Parameter is not required.

Info
iconfalse

Path parameters are always required.

1Parameter is required.

<<RESTOperationTag>>

With <<RESTOperationTag>> you can group your REST methods. Refer to Tagging REST Operations for more details.

Multiexcerpt
MultiExcerptNameRESTOperationTag
Tagged ValueDescription
Allowed Values
Name
(name)
Defines the name of the tag. This name will be displayed in the Bridge REST Test Tool as a group heading.any string
Description
(description)
You can add a short description of the tag that will be displayed in the Bridge REST Test Tool together with the heading.any string
External Documentation Description
(externalDocumentationDescription)
You can add a short description of the documentation.These field values will be generated to the OpenAPI descriptor, but are not displayed on the Test UI at the moment.any string
External Documentation URL
(externalDocumentationURL)
Defines a documentation URL for this tag group.a valid URL
Order
(order)
Defines the order in which the tag groups will be displayed on the screen. Tag groups with empty order will be displayed last.any number

<<RESTError>>

Multiexcerpt
MultiExcerptNameRESTError

Stereotype <<RESTError>> is used on a class to mark it as REST error class. Assign such a class to the REST port type (see <<E2ERESTPortType>>) and this class will be used as output in case of error. Each REST port type 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>;

<<RESTResponseDefinition>>

Multiexcerpt
MultiExcerptNameRESTResponseDefinition

Use dependencies with stereotype <<RESTResponseDefinition>> are used to connect REST resources with REST error classes.

Tagged ValueDescriptionAllowed Values
Name
(name)
Specify an HTTP status code. For this status code, the default error class will be overwritten by the specific error class.a specific HTTP status codee.g. 401
a patterne.g. 40? or 4??
all status codes???
Blob Body Content Type
(blobBodyContentType)
Specify a default content type for Blob parameters from this endpoint.
This information will be generated to the OpenAPI descriptor file and will will set the the "Content-Type" header to this content type.
a valid MIME-typee.g. application/msexcel
Default is application/octet-stream if not specified.

...