Uploaded image for project: 'OpenShift Console'
  1. OpenShift Console
  2. CONSOLE-3639

Omit JSON schema defaults from form generation

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • None
    • False
    • None
    • False

      According to the JSON schema spec, the default keyword specifies a default value that should only be used for informational purposes on the client side. Pre-filling a  form with schema default values is not semantically correct and can result in invalid form inputs since default values are not required to validate against the schema.

      Per the JSON Schema spec:

      The default keyword specifies a default value. This value is not used to fill in missing values during the validation process. Non-validation tools such as documentation generators or form generators may use this value to give hints to users about how to use a value. However, default is typically used to express that if a value is missing, then the value is semantically the same as if the value was present with the default value. The value of default should validate against the schema in which it resides, but that isn’t required.

       

      AC:

      • Form fields generated from JSON schema are not pre-filled with values defined by the "default" keyword.

            Unassigned Unassigned
            rh-ee-jonjacks Jon Jackson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: