Limitations on OpenAPI specifications and tools
You might face some restrictions concerning the OpenAPI specifications and tools when you use the hosted transparent decision service (HTDS) through OpenAPI-based clients.
Symptoms
You might encounter an issue in some specific use cases due to an incorrect behavior in some of the OpenAPI reference tools.
Table 1 describes the issues that you might encounter with the following tools:
- swagger-core Java™ library (embedded in the product): V1.5.10
- Swagger Codegen code generation tool: V2.2.1
- Swagger Editor: V2.10.3
New in 8.10.5 Operational Decision Manager currently uses OpenAPI 3.0. Table 2: OpenAPI 3.x data types and limitation shows the Java-type issues that you might encounter with the following tools:
- swagger-core Java™ library (embedded in the product): V2.1.4
- swagger-codegen code generation tool: V3.0.21
Diagnosing the problem
You cannot name ruleset parameters Request or Response.
| Data type | Limitation |
|---|---|
short type |
The OpenAPI specification has only int32 and int64
representations for integer, and standard integer numbers (int and
java.lang.Integer) and long numbers (long and
java.lang.Long) respectively for mapping. Short numbers ( As a consequence, when you use |
password data type annotation |
Customizing Java XOM fields with the
@ApiModelProperty annotation might be reflected on the OpenAPI definition file that
is generated by the HTDS. In particular, you might use the datatype property
to specify or override the type of the field of the Java
object in OpenAPI. However, if you set
password as a data type, the OpenAPI
definition file might not be generated. You will see the following
error:Unrecognized Type: [null] This problem is due to an incorrect
behavior in the swagger-core
Java library that is used for generating OpenAPI definition
files. Avoid using the As a workaround, you can use a
|
binary data type annotation |
Similar to the password data type, a String field in a Java XOM can be annotated with the
@ApiModelProperty annotation having binary as a data type
property. Unlike the However, if you use the Swagger Codegen tool to generate a Java client, the annotated field is represented as a In this particular use case, no such issue arises when you use the Swagger Editor. |
byte type |
When byte or java.lang.Byte is used as a XOM field or as a
ruleset parameter, it becomes byte[] in a Java client that is generated by the Swagger Codegen tool, which leads to a ruleset execution
error at run time. In this particular use case, no such issue arises when you use the Swagger Editor, since bytes are represented as strings, and the HTDS REST accepts and converts them to real bytes. |
arrays |
Arrays become lists when you use the Swagger Codegen tool to generate Java clients. For example, a field of type |
| Data type | Limitation |
|---|---|
byte type |
When If the value that is used is outside the limitation, the result should be wrong. |
char type |
When If the type is used with a string value length that is greater than 1, the execution throws an error. |
short type |
When If the value that is used is outside the short |