Creating an XML Schema for a Swagger 2.0 File Imported in TIBCO Business Studio™ for BusinessWorks™

TIBCO Business Studio for BusinessWorks supports the creation of an XML schema for an imported Swagger 2.0 file.

You can create an XML schema for the Swagger 2.0 files in one of two ways described below.

Prerequisites

The Swagger 2.0 file must exist in the Service Descriptors folder of the project. Be sure to import the Swagger file into the Service Descriptors folder before you follow these steps:

Procedure

  1. Drag and drop the Swagger file on the right side of the canvas to create a REST service binding. This action generates an XML schema for the Swagger file under the Schemas folder. The XML schema file has the same name as the Swagger file.
    Or
  2. Right-click the Swagger file in the Service Descriptors folder and select Refactor > Generate XSD Schema.
    Note:
    • To see which XML schema is related to the Swagger file, right-click the Swagger file and select Refactor > Open XSD Schema.
    • If you have multiple Swagger files all of which contain a definition for the same object, the definition for the object in all the Swagger files must be identical.
    • If you have multiple Swagger files with one file (a master file) containing a super set of definitions contained in the other files, generate an XSD file from the master Swagger file that contains the super set, and create links to the other files in the master Swagger file. If you create a link to the super set file in one of the subset files and then create an XSD from the subset file, then the XSD will contain only those elements that are common to both files. It will not contain elements for definitions that exist only in the super set file.