Enums
When defining schemas, we often need to restrict a property's values to a specific set of options.
To achieve this, we use enums to describe these predefined values.
Add Enums
There are two ways to add an enum:
- During the modeling of the use case.
- Through the Enum Management Panel.
Adding an Enum During Use Case Modeling
To add an enum while modeling a use case:
- Open the Use Case details by clicking on an API Use Case on the map.
- Navigate to the relevant section where you want to define a property.
- When adding or editing a property, select the type as "enum" (See Use Case Schema Editing).
- Click the + icon next to the enum dropdown.
In the dialog that appears, specify the name and the values for the enum.
You can add new values by clicking the + icon and finalize your creation by clicking on the checkmark symbol.
After submitting, your enum will be automatically selected for the property.
Please note that all input fields in the Codebricks Planner only allow lowercase letters and spaces.
No special characters are permitted to ensure a smooth generation experience.
Select Enum
To use an enum in any schema, follow these steps:
- Open the Use Case details by clicking on an API Use Case on the map.
- Navigate to the relevant section where you want to define a property.
- When adding or editing a property, select the type as "enum" (See Use Case Schema Editing).
- Choose the desired enum from the dropdown menu.
Manage Enums
To create, edit, or delete enums, use the Enum Management Panel:
- Open the Use Case details by clicking on any Use Case on the map.
- Open the management panel by clicking on the Candy Box icon (
).
- Move to the Enums tab.
Here, you can add, edit, or delete enums.
You can only delete enums that are not currently used in a Use Case.