-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚚 [#4980] Make few functions public API
to_multiple, rewrite_formio_components, and DataContainer need to be used in the JSON dump plugin
- Loading branch information
1 parent
b19056e
commit e84e3e1
Showing
6 changed files
with
23 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .logic.datastructures import DataContainer | ||
|
||
__all__ = ["DataContainer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from openforms.typing import JSONObject | ||
|
||
|
||
def to_multiple(schema: JSONObject) -> JSONObject: | ||
"""Convert a JSON schema of a component to a schema of multiple components. | ||
:param schema: JSON schema of a component. | ||
:returns: JSON schema of multiple components. | ||
""" | ||
title = schema.pop("title") | ||
return { | ||
"title": title, | ||
"type": "array", | ||
"items": schema, | ||
} |