plone / executioner

Admin interface for Guillotina
Other
1 stars 0 forks source link

JSON schema Dict field Error #17

Open bloodbare opened 5 years ago

bloodbare commented 5 years ago

On Guillotina CMS there are fields that are dict of jsonschema. Executioner is not able to handle with an error

Parsing error on /guillotina_cms.interfaces.base.ICMSBehavior.comments/: Provided json schema does not contain a 'properties' entry. Output schema will be empty

bloodbare commented 5 years ago

Schema:

{
    "title": "Container",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "required": [
        "type_name",
        "uuid"
    ],
    "definitions": {
        "guillotina.behaviors.dublincore.IDublinCore": {
            "type": "object",
            "properties": {
                "title": {
                    "type": "string",
                    "description": "The first unqualified Dublin Core 'Title' element value.",
                    "title": "Title"
                },
                "description": {
                    "type": "string",
                    "description": "The first unqualified Dublin Core 'Description' element value.",
                    "title": "Description"
                },
                "creation_date": {
                    "type": "datetime",
                    "description": "The date and time that an object is created. \nThis is normally set automatically.",
                    "title": "Creation Date"
                },
                "modification_date": {
                    "type": "datetime",
                    "description": "The date and time that the object was last modified in a\nmeaningful way.",
                    "title": "Modification Date"
                },
                "effective_date": {
                    "type": "datetime",
                    "description": "The date and time that an object should be published. ",
                    "title": "Effective Date"
                },
                "expiration_date": {
                    "type": "datetime",
                    "description": "The date and time that the object should become unpublished.",
                    "title": "Expiration Date"
                },
                "creators": {
                    "type": "array",
                    "description": "The unqualified Dublin Core 'Creator' element values",
                    "title": "Creators",
                    "items": {
                        "type": "string"
                    }
                },
                "tags": {
                    "type": "array",
                    "description": "The unqualified Dublin Core 'Tags' element values",
                    "title": "Tags",
                    "items": {
                        "type": "string"
                    }
                },
                "publisher": {
                    "type": "string",
                    "description": "The first unqualified Dublin Core 'Publisher' element value.",
                    "title": "Publisher"
                },
                "contributors": {
                    "type": "array",
                    "description": "The unqualified Dublin Core 'Contributor' element values",
                    "title": "Contributors",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "required": [],
            "invariants": [],
            "title": "Dublin Core fields",
            "description": ""
        },
        "guillotina_cms.interfaces.base.ICMSBehavior": {
            "type": "object",
            "properties": {
                "hidden_navigation": {
                    "type": "boolean",
                    "title": "Should be hidden on navigation"
                },
                "language": {
                    "type": "string",
                    "title": "Language",
                    "vocabularyName": "languages",
                    "vocabulary": {
                        "@id": "http://35.233.70.85:8080/db/cms/@vocabularies/languages"
                    }
                },
                "content_layout": {
                    "type": "string",
                    "default": "default",
                    "title": "Content Layout",
                    "vocabularyName": "content_layouts",
                    "vocabulary": {
                        "@id": "http://35.233.70.85:8080/db/cms/@vocabularies/content_layouts"
                    }
                },
                "allow_discussion": {
                    "type": "boolean",
                    "title": "Allow discussion"
                },
                "position_in_parent": {
                    "type": "integer",
                    "default": -1,
                    "title": "Position in parent"
                },
                "review_state": {
                    "type": "string",
                    "readonly": true,
                    "title": "Workflow review state",
                    "vocabularyName": "worklow_states",
                    "vocabulary": {
                        "@id": "http://35.233.70.85:8080/db/cms/@vocabularies/worklow_states"
                    }
                },
                "history": {
                    "type": "array",
                    "readonly": true,
                    "title": "History list",
                    "items": {
                        "actor": {
                            "type": "string"
                        },
                        "comments": {
                            "type": "string"
                        },
                        "time": {
                            "type": "string"
                        },
                        "type": {
                            "type": "string"
                        },
                        "title": {
                            "type": "string"
                        },
                        "data": {
                            "type": "object"
                        }
                    }
                },
                "comments": {
                    "type": "object",
                    "title": "Comments list field",
                    "additionalProperties": {
                        "type": "object",
                        "title": "Comment",
                        "properties": {
                            "actor": {
                                "type": "string"
                            },
                            "comments": {
                                "type": "string"
                            },
                            "time": {
                                "type": "string"
                            },
                            "type": {
                                "type": "string"
                            },
                            "title": {
                                "type": "string"
                            },
                            "data": {
                                "type": "object"
                            }
                        }
                    }
                }
            },
            "required": [],
            "invariants": [],
            "title": "CMS data behavior",
            "description": ""
        },
        "guillotina_cms.interfaces.tiles.ITiles": {
            "type": "object",
            "properties": {
                "tiles_layout": {
                    "type": "object",
                    "title": "Layout of the block",
                    "properties": {
                        "items": {
                            "type": "array"
                        }
                    }
                },
                "tiles": {
                    "type": "object",
                    "title": "Data of the block",
                    "properties": {}
                }
            },
            "required": [],
            "invariants": [],
            "title": "Tiles behavior",
            "description": ""
        }
    },
    "properties": {
        "__name__": {
            "type": "string",
            "description": "The object can be looked up from the parent's sublocations using this name.",
            "readonly": true,
            "title": "The name within the parent"
        },
        "type_name": {
            "type": "string",
            "readonly": true
        },
        "title": {
            "type": "string",
            "description": "Title of the Resource",
            "title": "Title"
        },
        "uuid": {
            "type": "string",
            "readonly": true,
            "title": "UUID"
        },
        "modification_date": {
            "type": "datetime",
            "title": "Modification date"
        },
        "creation_date": {
            "type": "datetime",
            "title": "Creation date"
        },
        "__behaviors__": {
            "type": "array",
            "description": "Dynamic behaviors for the content type",
            "readonly": true,
            "title": "Enabled behaviors"
        },
        "guillotina.behaviors.dublincore.IDublinCore": [
            {
                "$ref": "#/definitions/guillotina.behaviors.dublincore.IDublinCore"
            }
        ],
        "guillotina_cms.interfaces.base.ICMSBehavior": [
            {
                "$ref": "#/definitions/guillotina_cms.interfaces.base.ICMSBehavior"
            }
        ],
        "guillotina_cms.interfaces.tiles.ITiles": [
            {
                "$ref": "#/definitions/guillotina_cms.interfaces.tiles.ITiles"
            }
        ]
    },
    "invariants": [],
    "fieldsets": [
        {
            "fields": [
                "title",
                "guillotina.behaviors.dublincore.IDublinCore.description"
            ],
            "id": "default",
            "title": "default"
        },
        {
            "fields": [
                "guillotina.behaviors.dublincore.IDublinCore.effective_date",
                "guillotina.behaviors.dublincore.IDublinCore.expiration_date"
            ],
            "id": "dates",
            "title": "dates"
        },
        {
            "fields": [
                "guillotina.behaviors.dublincore.IDublinCore.creators",
                "guillotina.behaviors.dublincore.IDublinCore.publisher",
                "guillotina.behaviors.dublincore.IDublinCore.contributors"
            ],
            "id": "ownership",
            "title": "ownership"
        },
        {
            "fields": [
                "guillotina.behaviors.dublincore.IDublinCore.tags",
                "guillotina_cms.interfaces.base.ICMSBehavior.language"
            ],
            "id": "categorization",
            "title": "categorization"
        },
        {
            "fields": [
                "__name__",
                "guillotina_cms.interfaces.base.ICMSBehavior.hidden_navigation",
                "guillotina_cms.interfaces.base.ICMSBehavior.content_layout",
                "guillotina_cms.interfaces.base.ICMSBehavior.allow_discussion"
            ],
            "id": "settings",
            "title": "settings"
        }
    ],
    "layouts": []
}
bloodbare commented 5 years ago

So when JSON schema says additionalProperties: true means its a dict and there are no properties attribute.