Description
The Import from YAML option for new Domains imports a YAML file based on Open API version 2.0 specification. It loads the Domains onto the GenRocket web platform for the selected Project or Project Version. Domains are imported by reading the definitions section in the chosen YAML file.
Important: The YAML file for the import will need to either have a .yaml or .yml file extension and can contain only Swagger Open API version 2.0 domain definitions.
In This Article
- What Information can be added to the YAML file?
- Sample Definitions in YAML File
- How to Import Your Domains using a YAML File
- How to View an Audit of Your YAML Import
What Information can be added to the YAML file?
- At this time, YAML supports Name and Data Type only.
Sample Definitions in YAML File
definitions: Order: properties: id: type: integer format: int64 petId: type: integer format: int64 quantity: type: integer format: int32 shipDate: type: string format: date-time status: type: string description: Order Status enum: - placed - approved - delivered complete: type: boolean xml: name: Order Category: properties: id: type: integer format: int64 name: type: string xml: name: Category User: properties: id: type: integer format: int64 username: type: string firstName: type: string lastName: type: string email: type: string password: type: string phone: type: string userStatus: type: integer format: int32 description: User Status xml: name: User
Note: API specifications can be written in YAML or JSON. To learn more about OpenAPI (Formerly Swagger Specification), please refer to the following web page: https://swagger.io/docs/specification/about/.
How to Import Your Domains using a YAML File
Note: To import Domains with this option, you must have a YAML file to import from.
- Select a Project and Project Version in the Project Dashboard.
- Expand the New Domain menu and select Import from YAML.
- Select the Import from YAML option from the New Domain menu.
- Click the Choose File button to browse and select the YAML file from which the Domain definitions will be imported.
- Browse to the YAML file's save location on your local computer, select the YAML file, and click Open.
- When viewing a directory, only files with the .yaml and .yml file extensions will be displayed.
- Click the Save button in the dialog after selecting the YAML file.
- The following dialog will be provided to show that the required request has been added to the Queue.
- You will be notified when a Queue process is active and will receive an email when the process has been started.
- The YAML Import will appear within the Queue with a WAITING status, as shown below:
- As soon as the YAML parsing queue process is active, the user who requested the import and the Admin will receive a notification email to inform them that the YAML parsing queue process is active.
- The system will parse the YAML file's definition section to load Domain definitions into the GenRocket web platform.
- The user who initiated the import and the Admin will receive an email notification that the YAML parsing process has been completed.
Note: If the YAML parsing process fails for some reason with an error, the user who initiated the import and the Admin will receive an email notification regarding the error. - Once parsing has finished, you will be able to refresh the browser and see the imported Domains, as shown below:
- Click on a Domain to view each of the Attributes included in the import.
- The Attributes will be displayed within the Domain Dashboard as shown below:
Note: When Domains are imported using a YAML file, the Domain References (i.e., Parent/Child Relationships) will not show up in the Domain Reference Wizard.
How to View an Audit of Your YAML Import
Once a YAML Import has been initiated and either completed or failed with errors, you can see an audit of this process for the Project Version. To do so, complete these steps:
- Click on the Options (Cogwheel) menu for the appropriate Project Version in the Project Dashboard.
- Next, click the GenRocket Table Schema (GTS) Audit Details icon.
- An Audit pop-up window will appear. Here, you can see each attempted YAML Import, including the File Name, Date Activated, Status, any Errors, Success Count, and Error Count.
- To view the Audit Details for a specific YAML Import, tick the radial button to the left of the file name.
- Click Next to continue.
- Scroll up or down to view each Table Name and Domain Name.
- Click on a Domain Name to view its information within the Domain Dashboard.
- Click Close when finished.