Using an OpenAPI Specification
TIBCO Cloud Integration - Flogo (PAYG) gives you an option to create the Flogo app logic (flows) by importing an API specification file. You can simply drag a specification file to the TIBCO Cloud Integration - Flogo (PAYG) UI or navigate to it. If you have an existing specification file stored in the TIBCO Cloud™ Integration - API Modeler, select it when creating the flow. The flows for your app are automatically created based on the definitions in the specification file that you uploaded.
When you create an app from a specification, the ConfigureHTTPResponse and Return activities are automatically added in the flow. The mappings from trigger output to flow inputs get configured for you based on the definitions in the specification. The output of the ConfigureHTTPResponse activity is automatically mapped to the Return activity input. However, you must configure the input to the ConfigureHTTPResponse activity manually. If you have multiple response codes configured in the REST trigger, the first response code is configured in the ConfigureHTTPResponse activity by default. The only exception to this is if you have a response code of 200 configured. In that case, the 200 response code is configured in the ConfigureHTTPResponse activity by default.
Before the TIBCO Flogo® App is created, a validation process ensures that the features defined in the specification are supported in TIBCO Cloud Integration - Flogo (PAYG).
Considerations when using an API specification file to create a Flogo App:
- TIBCO Cloud Integration - Flogo (PAYG) supports Swagger Specification 2.0 and OpenAPI Specification 3.0.
- Currently, TIBCO Cloud Integration - Flogo (PAYG) supports only the JSON format.
- Cyclic dependency is not supported when creating flows from specifications. For example, if you have a type Book that contains an object element of type, Author. The type Author in turn contains an element of type Book which represents the books written by the author. To retrieve the Author, it creates a cyclic dependency where the Author object contains the Book object and the Book type in turn contains the Author object.
- Not all data types are supported in TIBCO Cloud Integration - Flogo (PAYG). A data type that appears in your specification but is not supported in TIBCO Cloud Integration - Flogo (PAYG) will result in an error being displayed.
- Schema references within schemas are not supported.
- If the specification has a response code other than 200 (OK) or 500 (Error), the method that contains the unsupported response code are not created.
- You can enter a schema for the response code 200, but the 500 response code must be a string.
- Basepath element in the schema is not supported.
If you get a validation error, you can either cancel the process of generating the app or click Continue. If you opt to continue, TIBCO Cloud Integration - Flogo (PAYG) continues with the app creation and ignores the parts of the specification that did not pass the validation.
To create an app using an API specification, follow these steps: