ajsf icon indicating copy to clipboard operation
ajsf copied to clipboard

AJSF doesn't render a form control for the standard JSON schema object "oneOf"

Open govindthakur25 opened this issue 4 years ago • 1 comments

Describe the bug which template:

  • MaterialDesignFrameworkModule — Material Design

Description: The form does not render when a standard JSON Schema, having the oneOf object, is supplied to an AJSF form.

To Reproduce Steps to reproduce the behavior:

  1. Take any standard JSON containing the oneOf object, e.g. below one.
{
   "schema": {
      "type": "object",
      "title": "CMAND Settings",
      "properties": {
         "ALG-Setting": {
            "type": "object",
            "title": "ALG Setting",
            "properties": {
               "SIP-CALLAGENT-IP": {
                  "type": "string",
                  "title": "Agent IP",
                  "pattern": "^(?:[A-F0-9]{1,4}:){7}[A-F0-9]{1,4}$",
                  "description": "Agent IPv6 Address"
               },
               "SIP-PORT": {
                  "type": "number",
                  "title": "SIP Port",
                  "minimum": 0,
                  "maximum": 15
               },
               "Route-Table": {
                  "oneOf": [
                    {
                      "type": "integer"
                    },
                    {
                        "type": "string",
                        "enum": [
                          "Local",
                          "Main",
                          "Default",
                          "All",
                          "Unspec"
                        ]
                    }
                  ]
                }
            }
         }
      }
   }
}
  1. Use it on the online demo url
  2. The form is rendered, but the specific field with "oneOf" identifier (Route-Table in this case), is not rendered.

Expected behavior The field with the oneOf object must be rendered.

Screenshots after-removing-properties

govindthakur25 avatar Oct 23 '20 13:10 govindthakur25

@hamzahamidi - could you please review this issue and provide your inputs?

govindthakur25 avatar Nov 24 '20 06:11 govindthakur25