Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/user_docs/guides/schema-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ The content of `app_module.k` is
schema App:
domainType: "Standard" | "Customized" | "Global"
containerPort: int
services?: [Service]
volumes: [Volume]
services: [Service]

check:
1 <= containerPort <= 65535
Expand All @@ -89,8 +89,8 @@ In the above file, we use the `schema` keyword to define three models `App`, `Se

- The type of `domainType` is a string literal union type, similar to an "enumeration", which means that the value of `domainType` can only take one of `"Standard"`, `"Customized"` and `"Global"`.
- The type of `containerPort` is an integer (`int`). In addition, we use the `check` keyword to define its value range from 1 to 65535.
- The type of `services` is `Service` schema list type, and we use `?` to mark it as an optional attribute.
- The type of `volumes` is a `Volume` schema list type, and we use `?` to mark it as an optional attribute.
- The type of `services` is `Service` schema list type, and we use `?` to mark it as an optional attribute. Deleting it from `main.k` would still output a valid yaml.
- The type of `volumes` is a `Volume` schema list type.

We can get the YAML output of the `app` instance by using the following command line

Expand Down