Skip to main content

Support for Union Types And Other Type Constructs Added in API Transformer and Dashboard Import

· 3 min read

Support for union types and other type constructs (oneOf, anyOf, not) has now been added to API Transformer and can also affect how your import in the Dashboard works. Re-transform/re-import your files to get these latest changes. Learn more about how (and if) these changes will affect you if you use any of these constructs in your API specification file.

Details#

Release Note

We are aiming to roll out these changes mid of January so it is strongly recommended that you review these changes carefully to learn whether they will affect you or not. Accordingly, make any necessary adjustments before then to your API specification, if required, to avoid any issues. Note, however, that these changes will only affect you if you choose to re-transform or re-import your files after the changes are released.

Various API description formats support type combining constructs like anyOf, oneOf and not. Others like RAML support "union" types which are a kind of an equivalent of one of these constructs. We have now added support for these constructs across format parsers of API Blueprint, RAML, OpenAPI, WSDL, WADL and of secondary formats like JSON Schema and XML Schema.

Impact Details: These new features will help reduce loss of information related to these constructs during the transformation/import process. However, loading this additional type information can also result in new models/types which can impact not just the transformation but also imports you make in your Dashboard that in return can impact the types appearing in your SDKs/Docs.

How to disable this feature?

If you do not wish to receive these changes, please upload a Metadata file along with your files with the ImportTypeCombinators import setting set to false. Note that RAML v1.0 users should also disable the import setting UseRamlUnionTypeAsOneOf to prevent related changes.

A detailed breakdown of the support for this feature across formats is given below:

OpenAPI v3.0#

OpenAPI v3.0 supports constructs like anyOf, oneOf and not for its Schema Object. API Transformer and our Dashboard import/export feature now supports these constructs.

RAML v0.8 and v1.0#

RAML v1.0 supports union types which the API Transformer and Dashboard import/export feature will now support.

RAML v0.8 supports named parameters with multiple types which are now also supported in API Transformer and our Dashboard import/export feature.

JSON Schema#

JSON Schema supports constructs like anyOf, oneOf and not which API Transformer and Dashboard import/export now also supports for raw JSON schema files as well as embedded JSON schema cases like in API Blueprint or RAML v0.8 files etc.

XML Schema#

XML Schema supports union types xsd:union for which we previously created a new merged type out of all types listed. However, they will now be loaded separately and treated as a case equivalent of oneOf types. This change will reflect in API transformations and Dashboard import/export of raw XML schema files or embedded cases in WSDL and WADL files.