jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Remove AJV usage from combinator mappers

Open lucas-koehler opened this issue 1 year ago • 0 comments

Direct AJV usage in renderers (i.e. oneof renderer to determine applicable sub schema) should be removed completely as this is a hacky attempt to select the suitable subschema. In general, we want to get rid of mandatory ajv usage in general.

For combinator renderers, AJV is invoked in mapStateToCombinatorRendererProps. This should be re-written to use a heuristic instead:

  • If there is an type/kind/id (in this order) attribute: use to select initial entry. See if we can match this against a const in the schema. Otherwise try with first string and/or number property.
  • id property should be configurable via a custom JSON Schema attribute (we already use a custom i18n attribute). The new attribute should start with x-jsf-. I.e. x-jsf-type-property
  • allOf: Investigate whether calling mapStateToCombinatorRendererProps in mapStateToAllOfProps is necessary

lucas-koehler avatar Aug 28 '24 15:08 lucas-koehler