Overview

The Import from YAML option for new Domains imports a YAML file based on Open API version 2.0 specification and 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.


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

To import Domains with this option, you will need to have YAML file available to import from.

  • Select the correct Project and Project Version within the Project Dashboard.

  • Next, click on the New Domain button within the Domains pane.


  • Select the Import from YAML option from the New Domain menu.to load the Domains onto the GenRocket web platform.


  • Click on the Choose File button to browse to and select the YAML file the Domain definitions will be imported from.


  • 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.


    Note: The YAML file with will need to either have a ,yaml or .yml file extension and can contain only Swagger Open API version 2.0 domain definitions.

  • 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 successfully 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 successfully completed or failed with errors, you will be able to 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 on 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.