ROHttpAPIMethodAttribute
Overview
Identifies HttpAPI method.
Location
- Unit: uRORTTIAttributes.pas
- Ancestry: TCustomAttribute | ROHttpAPIMethodAttribute
constructor Create
Name of the wrapper method parameters structure.
constructor Create(aPath: string; aMethod: string; aResultCode: Integer; aTags: string; aOperationId: string; aRequestName: string)
Parameters:
- aPath: The url template that can be used to call the service method.
- aMethod: HTTP method that will be used to call the service.
- aResultCode: HTTP response code
- aTags: comma-separated string containing a list of tags that are applied to the service method.
- aOperationId: custom operation name
- aRequestName: Name of the wrapper method parameters structure.
Method
HTTP method that will be used to call the service. By default the POST method is used.
property Method: string read
OperationId
custom operation name that can be used by the client code codegen instead of operation name that was auto-generated based on the API method path and Http method. For obvious reasons this operation name should be unique server-wide.
property OperationId: string read
Path
The url template that can be used to call the service method. The path parts in the curly braces {}
are bindings of the method parameters. When the method is called the corresponding part of the Url is extracted and provided as the service method parameter value.
Note: Only parameters of string, number, boolean, enumeration type can be bound via api method path.
property Path: string read
RequestName
Name of the wrapper method parameters structure. By default server metainformation describes method parameters as a structure named {ServiceName}{MethodName}Request
(f.e. LoginServiceLoginRequest
). This optional parameter allows to override the auto-generated wrapper name. Redefined wrapper name should be unique server-wide.
property RequestName: string read
ResultCode
HTTP response code that will be sent back to the client on successful method execution. By default the response will have the 200 OK Http code.
property ResultCode: Integer read
Tags
comma-separated string containing a list of tags that are applied to the service method. These tags are exposed via OpenAPI description file and are used by some codegens (f.e. the Swagger one) to group method proxies in the generated code.
property Tags: string read
Method
HTTP method that will be used to call the service. By default the POST method is used.
property Method: string read
OperationId
custom operation name that can be used by the client code codegen instead of operation name that was auto-generated based on the API method path and Http method. For obvious reasons this operation name should be unique server-wide.
property OperationId: string read
Path
The url template that can be used to call the service method. The path parts in the curly braces {}
are bindings of the method parameters. When the method is called the corresponding part of the Url is extracted and provided as the service method parameter value.
Note: Only parameters of string, number, boolean, enumeration type can be bound via api method path.
property Path: string read
RequestName
Name of the wrapper method parameters structure. By default server metainformation describes method parameters as a structure named {ServiceName}{MethodName}Request
(f.e. LoginServiceLoginRequest
). This optional parameter allows to override the auto-generated wrapper name. Redefined wrapper name should be unique server-wide.
property RequestName: string read
ResultCode
HTTP response code that will be sent back to the client on successful method execution. By default the response will have the 200 OK Http code.
property ResultCode: Integer read
Tags
comma-separated string containing a list of tags that are applied to the service method. These tags are exposed via OpenAPI description file and are used by some codegens (f.e. the Swagger one) to group method proxies in the generated code.
property Tags: string read
constructor Create
Name of the wrapper method parameters structure.
constructor Create(aPath: string; aMethod: string; aResultCode: Integer; aTags: string; aOperationId: string; aRequestName: string)
Parameters:
- aPath: The url template that can be used to call the service method.
- aMethod: HTTP method that will be used to call the service.
- aResultCode: HTTP response code
- aTags: comma-separated string containing a list of tags that are applied to the service method.
- aOperationId: custom operation name
- aRequestName: Name of the wrapper method parameters structure.