balena-io-modules / jellyschema

JellySchema - data validation, UI form generation
Apache License 2.0
4 stars 2 forks source link

Not emitting every specified field in UI schema #48

Closed cyplo closed 5 years ago

cyplo commented 5 years ago
---
version: 1
title: ResinOS Technologic TS-4900 Configuration
properties:
  - board:
      title: CPU Cores
      warning: |-
        Please make sure to select the correct number of CPU Cores for your device.
        **Failing to do so will brick your device**.
      properties:
        - cores:
            type: integer
            default: 1
            enum:
              - value: 1
                title: Single
              - value: 4
                title: Quad
  - network:
      title: Network Connection
      properties:
        - networks:
            type: array
            items:
              title: WiFi Network
              properties:
              - ssid:
                  title: Network SSID
                  type: string
              - psk:
                  title: Network password
                  type: password
              warning: |-
                In order to have usable WiFi connectivity, make sure you have attached
                a WiFi antenna to your WiFi module.
  - advanced:
      title: Advanced
      collapsed: true
      properties:
        - appUpdatePollInterval:
            title: Application update poll interval
            help: Check for updates every X minutes
            type: integer
            min: 10
            default: 10

gives just

{
  "board": {
    "ui:description": null,
    "ui:help": null,
    "ui:warning": "Please make sure to select the correct number of CPU Cores for your device.\n**Failing to do so will brick your device**."
  }
}

as the UI schema - which missed the network and advanced warnings

cyplo commented 5 years ago

This is needed to be able to support binary type fully (#55) as we need to emit UISchema for an array