apache / incubator-kie-issues

Apache License 2.0
12 stars 1 forks source link

Dev UI start form does not support default values #1005

Open caponetto opened 5 months ago

caponetto commented 5 months ago

Consider the following JSON Schema:

{
  "$id": "classpath:/schemas/yamlgreet__main-schema.json",
  "title": "Data Input Schema",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "language": {
      "title": "Language",
      "description": "Language to greet",
      "type": "string",
      "enum": ["English", "Spanish"],
      "default": "English"
    },
    "name": {
      "title": "Name",
      "description": "Name of the person",
      "type": "string",
      "default": "John Doe"
    }
  },
  "required": ["name"]
}

Both properties include a default value but they are not shown in the start form:

image

Here is an example of the expected form (using another form generation library).

If you inspect the generated openapi.json file by the engine, you'll notice that the default value is not there.

{
   "title":"Data Input Schema",
   "required":[
      "name"
   ],
   "type":"object",
   "properties":{
      "language":{
         "title":"Language",
         "description":"Language to greet",
         "type":"string"
      },
      "name":{
         "title":"Name",
         "description":"Name of the person",
         "type":"string"
      }
   }
}
caponetto commented 5 months ago

FYI @fjtirado @paulovmr