json-schema-form-core icon indicating copy to clipboard operation
json-schema-form-core copied to clipboard

fix(canonical-title-map): add use case for enumNames

Open jmfrancois opened this issue 8 years ago • 0 comments

Description

Add support case for enumNames. Spec: https://github.com/json-schema-org/json-schema-spec/issues/57

We have some schemas with the following shape:

{
  "jsonSchema": {
    "type": "object",
    "title": "Datalist",
    "properties": {
      "test": {
        "type": "string",
        "enum": [ "a", "p", "b", "c", "l", "g" ],
        "enumNames": [ "Apple", "Pine[apple]", "Banana", "Cher[ry", "Lemo}n", "Grapefruit" ]
      }
    },
    "required": [
      "test"
    ]
  },
  "uiSchema": [
    {
      "key": "test",
      "title": "Datalist with named options",
      "widget": "datalist"
    }
  ],
  "properties": {
    "test": "Pine[apple]"
  }
}

This raise exception with the current implementation because we have an array of value for the titleMap;

Checklist

  • [x] I have read and understand the CONTRIBUTIONS.md file
  • [ ] I have searched for and linked related issues
  • [x] I have created test cases to ensure quick resolution of the PR is easier
  • [x] I am NOT targeting master branch
  • [x] I did NOT include the dist folder in my PR

@json-schema-form/angular-schema-form-lead

jmfrancois avatar Dec 11 '17 15:12 jmfrancois