Nested Ref not showing, no UI Schema

Not currently using a UI Schema. I created two definitions to highlight the issue, one called ‘recurrence’ and another called ‘recurrence_array’. When referencing the ‘recurrence’ it does NOT render, however when I reference ‘recurrence_array’ it does. The difference being one is a single instance versus being an array. For some reason, changing to an items allows it to show, however not clear why.

This is the part not working

                "recurrence": {
                    "type": "object",
                    "$ref": "#/definitions/recurrence"
                },

Full Shema Json.

{
    "definitions": {
        "property": {
            "properties": {
                "name": {
                    "type": "string",
                    "minLength": 1
                },
                "description": {
                    "title": "Long Description",
                    "type": "string"
                },
                "done": {
                    "type": "boolean"
                },
                "due_date": {
                    "type": "string",
                    "format": "date"
                },
                "rating": {
                    "type": "integer",
                    "maximum": 5
                },
                "recurrence": {
                    "type": "object",
                    "$ref": "#/definitions/recurrence"
                },
                "recurrence_array": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/recurrence_array"
                    }
                }
            },
            "required": ["name", "due_date"]
        },
        "recurrence": {
            "type": "object",
            "properties": {
                "recurrence": {
                    "type": "string",
                    "enum": ["Never", "Daily", "Weekly", "Monthly"]
                },
                "recurrence_interval": {
                    "type": "integer"
                }
            }
        },
        "recurrence_array": {
            "type": "object",
            "properties": {
                "recurrence_array": {
                    "type": "string",
                    "enum": ["Never", "Daily", "Weekly", "Monthly"]
                },
                "recurrence_interval_array": {
                    "type": "integer"
                }
            }
        }
    },
    "properties": {
        "property": {
            "$ref": "#/definitions/property"
        }
    }
}

Hi @hellsfantasy ,

Can you try removing the "type": "object", here? It is not necessary because the referenced schema specifies that anyway. It may confuse the UI schema generation or renderer resolvement.

Best regards,
Lucas

I tested the schema in our JSON Forms React seed.

The problem is that the UI Schema generated for the object located in #/properties/property does not include a control for #/property/recurrence. This happens because the UI Schema generator is not handed over the rootSchema and is therefore not able to resolve the $ref of recurrence. It works for the array as the UI Schema generator is not resolving here itself.

The issue is in these two lines of code where we hand over not enough parameters: https://github.com/eclipsesource/jsonforms/blob/9146b0fdf5913d2251fadd5435d2c7e813db6f71/packages/material-renderers/src/complex/MaterialObjectRenderer.tsx#L59-L60

@hellsfantasy Would you be able to contribute and test a fix?

@sdirix Could you please merge this PR fix(material): Resolve refs in object renderer by LukasBoll · Pull Request #2202 · eclipsesource/jsonforms · GitHub as soon as possible.

Hi @iashupal,

We’ll check what we can do. I think merging and releasing a new version next week is realistic. However I can’t give you any guarantee outside of the professional support.