Delphi Developers’ Reference¶
Thriftly Metadata Encyclopedia¶
This section provides additional details on the Thriftly-specific metadata you’ll add to your application as you create APIs and implement various Beyond the Basics features:
[AuthAttribute]: Used to specify the function that protects your service’s other functions, if you have chosen to implement JWT-based authorization (as described in the Securing Your API with JSON Web Tokens (JWTs) topic). You should never publish the function that uses this attribute, and largely, you should write the function that uses this attribute exactly as that function is written in our documentation. For example, your Auth function must include all three of and only the imethodID: Integer, sMethodName: String,and toke: TToken parameters. Your place this attribute directly above your Auth function, within your service’s public section.
[DocumentationAttribute]: Used to provide documentation for your API (as described in the Adding and Accessing API Documentation section). Using iterations of this attribute, you can provide other developers with a description of what a particular function within your API does and what parameters that function includes. This documentation then appears at your service’s service URL when you publish your API on the Thriftly Server. You place this attribute both above and within your function.
[PublishedAttribute]: Used to make a function accessible as part of your Thriftly API. When you publish an application service as an API, Thriftly makes any functions marked with [PublishedAttribute] available over the Thriftly Server, allowing developers to integrate that function into new applications. Note that if a service contains multiple functions, some of which do not include [PublishedAttribute], only functions that include [PublishedAttribute] are published as part of your API. In this way, you can publish some functions within a service while keeping others private. You place this attribute above the function you want to make available as part of your API, within your service’s public section.
[UnsecuredAttribute]: Used to specify functions that should not be secured, if you have chosen to implement JWT-based authorization (as described in the Securing Your API with JSON Web Tokens (JWTs) topic). Primarily, this attribute is used to specify which function within your service should be recognized as a login function. Typically, if you implement JWT-based authorization, users will have to perform a valid call to your login function to receive a JWT and use the other functions included within your service. However, you can also add the [UnsecuredAttribute] to other functions within your service, if you do not want to require users to retrieve and provide a valid JWT before using those functions. You place this attribute above the [PublishedAttribute].
Thriftly-Supported Data Types¶
This section lists the subset of Delphi data types that Thriftly supports. Thriftly supports only a subset of data types. For example, Thriftly does not support pointer types or variant type parameters, because Thriftly itself is strongly typed. Our list of supported data types includes:
Arrays of supported types
UChar (Note: Thriftly treats UChar functions as binary functions. You can use UChar functions to pass or return binary data from your APIs.)