Using a Swagger Specification

TIBCO Cloud Integration- Flogo (PAYG) gives you the option to create the Flogo app logic (flows) by importing a Swagger 2.0 specification file. You simply drag and drop a Swagger file into the TIBCO Cloud Integration- Flogo (PAYG) UI and the flows for your app automatically get created based on the definitions in the Swagger file that you uploaded.

Note: TIBCO Cloud Integration- Flogo (PAYG) supports Swagger 2.0.
Note: Currently, TIBCO Cloud Integration- Flogo (PAYG) supports only the JSON format.
Note: Cyclic dependency is not supported while creating flows from Swagger specifications. For example, if you have a type Book which 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 retreive 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.

To upload your Swagger file, follow these steps:

Procedure

  1. Open the app details page and click + Create if this is your first flow or if a flow already exists click the Create button.
  2. Select From Swagger specifications.
  3. Upload your Swagger file by either dragging and dropping it or navigating to it using the browse to upload link.
    TIBCO Cloud Integration- Flogo (PAYG) validates your file extension. If your file extension is .json, you see a green check mark and the Upload button appears.
  4. Click Upload.
    TIBCO Cloud Integration- Flogo (PAYG) validates the contents of your file and if it passes the validation, it creates the flows based on the definitions in the file. One flow gets created for each method and path combination defined in the file. If there are errors in your file, you get warning messages saying so, but you have the option to continue with creating the flows. If you click Continue, the flows get created for supported methods only. Other issues must be fixed before you can upload the file again.
    Note: Currently, the following are not supported:
    • PATCH method
    • Form data content type
    • Same root having a static path and a parameterised path in the file, for example, /foo/bar and /foo/{id}. But having two static paths are supported, for example, /foo/bar and /foo/bar1
  5. In each flow, do the following:
    1. Open the flow by clicking on its name.
    2. Click the trigger to open its configuration dialog.
    3. Map the following:
      • In the Map to Flow Inputs tab, map the Trigger Output to Flow Input.
      • In the Map from Flow Outputs tab, map the Flow Output to Trigger Reply.
Related tasks