DataFlex 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:

  • {AuthMethod=True}: 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 Integer imethodID, String sMethodName,and token toke parameters. You place this attribute directly above your Auth function.

  • {LoginMethod=True}: Used to specify your login function, if you have chosen to implement JWT-based authorization (as described in the Securing Your API with JSON Web Tokens (JWTs) topic). 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. You place this attribute directly above the function you want to use as a login function. Note that you do not have to place the {Published=True} attribute above this function, as the Thriftly Server will automatically publish any function marked with the {LoginMethod=True} attribute.

  • {Published=True}: 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 the {Published=True} attribute 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 the {Published=True} attribute, only functions that include {Published=True} 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 accessible as part of your API.

  • /ServiceName.FunctionName: Used to provide documentation for your API (as described in the Adding and Accessing API Documentation section). Using this tag, and the corresponding /* tag, you can provide other developers with a description of what a particular function within your API does, what parameters that function includes, and what values that function returns. This documentation then appears at your service’s service URL when you publish your API on the Thriftly Server. You place this tag above your function.

Thriftly-Supported Data Types

This section lists the subset of DataFlex 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 (Note: Thriftly does not support number/decimal arrays, dynamic multidimensional arrays, and jagged arrays, due to DataFlex’s own limitations.)

  • BigInt

  • Boolean

  • Date

  • Datetime

  • Float/Real

  • Integer

  • Number/Decimal

  • Short

  • String

  • Struct

  • UChar (Note: Thriftly treats UChar functions as binary functions. You can use UChar functions to pass or return binary data from your APIs.)