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