jmrivas86 / django-json-widget

An alternative widget that makes it easy to edit the new Django's field JSONField (PostgreSQL specific model fields)
MIT License
440 stars 88 forks source link

allowSchemaSuggestions Not Working #87

Open eddysanoli opened 5 months ago

eddysanoli commented 5 months ago

Description

Hey, I was trying to use the allowSchemaSuggestions option from the jsoneditor package. Passed the argument as part of the options of the JSON editor widget, but when the page loads I get the warning:

Unknown option "allowSchemaSuggestions". This option will be ignored

What I Did

This is the configuration for my Widget

        widgets = {
            'configuration': JSONEditorWidget(
                attrs={"style": "width: 100%; border: none; padding: unset;"},
                options={
                    "allowSchemaSuggestions": True,
                    "schema": {
                        "$schema": "http://json-schema.org/draft-07/schema#",
                        "$id": "tag-configuration-schema",
                        "title": "Title",
                        "description": "Description",
                        "type": "object",
                        "additionalProperties": False,
                        "properties": {
                            "type": {
                               "type": "string",
                               "enum": ["access", "trunk"]
                            },
                            "vlan": {
                                "type": "number"
                            },
                            "isolationEnabled": {
                                "type": "boolean"
                            },
                        },
                        "required": []
                    }
                }
            ),
        }