apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition 
metadata:
  name: tableformats.fluvio.infinyon.com
spec:
  group: fluvio.infinyon.com
  scope: Namespaced
  names:
    kind: TableFormat
    plural: tableformats
    singular: tableformat
  versions:
    - name: v1
      served: true
      storage:  true
      subresources:
          status: {}
      schema:
        openAPIV3Schema:
          required: ["spec"]
          type: object
          properties:
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
            spec:
              type: object
              required: ["name"]
              properties:
                name:
                  type: string
                  minimum: 1
                  maximum: 100
                inputFormat:
                  type: string
                  enum:
                    - JSON
                    - YAML
                    - TOML
                columns:
                  type: array
                  items:
                    type: object
                    properties:
                      headerLabel:
                        type: string
                      width:
                        type: integer 
                      alignment:
                        type: string
                        enum:
                          - LEFT
                          - CENTER
                          - RIGHT
                      keyPath:
                        type: string
                      format:
                        type: string
                      display:
                        type: boolean 
                      primaryKey:
                        type: boolean 
                      headerBgColor:
                        type: string
                        enum:
                          - BLUE
                      headerFgColor:
                        type: string
                        enum:
                          - YELLOW
                smartmodule:
                  type: string