Skip to content
Snippets Groups Projects
Commit 10c08503 authored by Julian's avatar Julian
Browse files

Correctly create schemas for Layouts

parent 5c05fb4e
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,13 @@ from .jsonschema import JSONSchema ...@@ -4,8 +4,13 @@ from .jsonschema import JSONSchema
class JSONSchemaFormMixin: class JSONSchemaFormMixin:
layout = None
def as_jsonschema(self: Form) -> dict: def as_jsonschema(self: Form) -> dict:
schema = JSONSchema() schema = JSONSchema()
for name, field in self.fields.items(): if self.layout is None:
schema.add_field(name, field) for name, field in self.fields.items():
schema.add_field(name, field)
else:
schema.update_properties(self.layout.build_schema(schema, self.fields)["properties"])
return schema.schema return schema.schema
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment