OpenAPI types mapping: BDL
Conversion mapping for Genero BDL data types in OpenAPI documentation.
| Genero BDL data types | JSON data types | Format | Additional format keywords |
|---|---|---|---|
| STRING | STRING | ||
| VARCHAR(n) | STRING | maxLength: n
For an example, go to VARCHAR(N) |
|
| CHAR(n) | STRING | maxLength: n
For an example, go to CHAR(n) |
|
| DATE | STRING | format: date |
For examples of date conversion, go to DATE |
| DATETIME YEAR TO DAY | STRING | format: date |
For examples of datetime conversion, go to DATETIME |
| DATETIME YEAR TO MINUTE, DATETIME YEAR TO SECOND, DATETIME YEAR TO FRACTION(n) | STRING | format: date-time |
For examples of datetime conversion, go to DATETIME |
| DATETIME YEAR TO YEAR, DATETIME YEAR TO MONTH, DATETIME YEAR TO HOUR, or any qualifier that does not start at YEAR (such as HOUR TO MINUTE or MONTH TO DAY) | STRING | For examples of datetime conversion, go to DATETIME | |
| INTERVAL (DAY TO SECOND and YEAR TO MONTH classes) | STRING | format: duration |
|
| TEXT | STRING | ||
| BYTE | STRING | format: binary |
|
| BOOLEAN | BOOLEAN | ||
| INTEGER | INTEGER |
|
|
| TINYINT | INTEGER | ||
| SMALLINT | INTEGER | ||
| BIGINT | INTEGER |
|
|
| DECIMAL | NUMBER | For examples of decimal conversion, go to DECIMAL(p,s) | |
| SMALLFLOAT | NUMBER | format: float |
|
| FLOAT | NUMBER | format: double |
|
| MONEY | NUMBER | format: double |
|
| RECORD | OBJECT | ||
| DYNAMIC ARRAY OF | ARRAY | For examples handling nulls in arrays, go to Example 2: Handling arrays with null values | |
| ARRAY [ ] OF | N/A | N/A | |
| DICTIONARY OF | OBJECT | additionalProperties:"type":"object" |
|
| util.JSONObject | OBJECT | additionalProperties: {} |
|
| util.JSONArray | OBJECT | additionalProperties: {} |
|
json_null="null"
attribute set to allow null values to deserialize JSON null values into BDL variables, or to
enable serialization of null values from BDL to JSON. |
All primitive and complex data types | nullable: true |
For examples, go to Example 1: Primitive and complex types with null values |
Converting OpenAPI types to BDL in client stubs
When fglrestful generates a client stub, it uses the OpenAPI format keywords
in the Additional format keywords column above to convert OpenAPI property
types to precise BDL types. For example, a JSON STRING property with
maxLength: 50 becomes VARCHAR(50) in the stub, and a
NUMBER property with multipleOf, minimum, and
maximum keywords becomes DECIMAL(P,S).
Use the --ignore-restrictions option with fglrestful to
bypass this conversion: string properties fall back to STRING and numeric
properties to unparameterized DECIMAL (maximum-precision). For details, see --ignore-restrictions.