You can import an OpenAPI file describing a REST interface directly from a file or via a URL. The importer will generate all necessary interface elements to your UML model to use this REST service with the REST Adapter.
The OpenAPI import rules are described in detail in REST Import Rules.
To import an OpenAPI for REST, select Import > OpenAPI from the Model Compiler menu.
Enter a file location or an URL. By clicking , you can use the File Chooser to lookup the file. Note the following for Bridge REST services: Click OK. | |
The selected OpenAPI file can be imported into either an existing or a new UML model. Click OK to import the definitions. You can still cancel the import by clicking Cancel. |
The importer generates the interface definitions to a new repository package having the name of the import file.
Import Problems
The xUML REST Importer can import YAML files only. If the service you want to call provides an OpenAPI file in JSON only, you can convert the JSON file to YAML before importing it. You can find many JSON to YAML converters on the internet. After having imported a YAML file, it may that some special options (like e.g. isVerbatimPath or externalName) that are not part of the official Open API description, are not set, but may be necessary. In these cases, you will have to edit the import file manually to add blob parameters and set these options. It may be that the import of the YAML file fails or the REST service provides no description file at all. In this case, you canThe REST Service Only Provides a JSON Definition File
The YAML File Does Not Set All Necessary Options
Also, blob parameters, Blob Body Content Type/Reject Other Response Content Type and Accepted Request Content Type/Reject Other Request Content Types as described on Handling Blobs in the REST Interface are not supported by the importer.The Import of the YAML File Fails Or The REST Service Provides No Description File At All