Generating OpenAPI Schema

    1. NAME DATA AGE
    2. schema-ingress 1 46m
    3. schema-scaler 1 50m
    4. schema-webservice 1 2m26s
    5. schema-webservice-v1 1 40s
    6. schema-worker 1 1m45s
    7. schema-worker-v1 1 55s
    8. schema-worker-v2 1 20s

    For the sack of convenience, we also specify a unified label for the which stores the parameter information of the same Definition. And we can list the ConfigMap which stores the parameter of the same Definition by specifying the label like definition.oam.dev/name=definitionName, where the definitionName is the specific name of your component or trait.

    1. schema-worker 1 1m50s
    2. schema-worker-v1 1 1m
    3. schema-worker-v2 1 25s

    For example, we can use the following command to get the JSON schema of webservice.

    1. apiVersion: v1
    2. kind: ConfigMap
    3. metadata:
    4. name: schema-webservice
    5. namespace: vela-system
    6. openapi-v3-json-schema: '{"properties":{"cmd":{"description":"Commands to run in
    7. of CPU units for the service, like `0.5` (0.5 CPU core), `1` (1 CPU core)","title":"cpu","type":"string"},"env":{"description":"Define
    8. arguments by using environment variables","items":{"properties":{"name":{"description":"Environment
    9. variable name","title":"name","type":"string"},"value":{"description":"The value
    10. of the environment variable","title":"value","type":"string"},"valueFrom":{"description":"Specifies
    11. a source the value of this var should come from","properties":{"secretKeyRef":{"description":"Selects
    12. a key of a secret in the pod''s namespace","properties":{"key":{"description":"The
    13. key of the secret to select from. Must be a valid secret key","title":"key","type":"string"},"name":{"description":"The
    14. name of the secret in the pod''s namespace to select from","title":"name","type":"string"}},"required":["name","key"],"title":"secretKeyRef","type":"object"}},"required":["secretKeyRef"],"title":"valueFrom","type":"object"}},"required":["name"],"type":"object"},"title":"env","type":"array"},"image":{"description":"Which
    15. image would you like to use for your service","title":"image","type":"string"},"port":{"default":80,"description":"Which
    16. port do you want customer traffic sent to","title":"port","type":"integer"}},"required":["image","port"],"type":"object"}'
    • For Terraform based definition: the variable is the keyword in TF template.

    Next

    Refer to UX of Definition