Skip to content

fix: Docs - Semantics around optionals #521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 5, 2025
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