Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add json schema to submitted data of json dump plugin #5007

Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
573492f
:sparkles: [#4980] Add json schema definition to static variables
viktorvanwijk Jan 7, 2025
e0a1760
:sparkles: [#4980] Add json schema definition to formio components
viktorvanwijk Jan 7, 2025
791b151
:sparkles: [#4980] Add function to generate JSON schema from a form a…
viktorvanwijk Jan 8, 2025
e6bb253
:white_check_mark: [#4980] Add tests
viktorvanwijk Jan 8, 2025
4867708
:sparkles: [#4980] Add schema definitions for user-defined variables
viktorvanwijk Jan 10, 2025
0c77904
:sparkles: [#4980] Process file schema to make it represent the data …
viktorvanwijk Jan 10, 2025
1f8ee58
:bug: [#4980] Add empty string to list of choices to account for an u…
viktorvanwijk Jan 10, 2025
92b5db5
:bug: [#4980] Set required properties in select boxes schema to empty…
viktorvanwijk Jan 10, 2025
6000596
:bug: [#4980] Revise as_json_schema for select, select boxes, and rad…
viktorvanwijk Jan 13, 2025
6e11e3b
:sparkles: [#4980] Revise processing of radio, select, and selectboxe…
viktorvanwijk Jan 15, 2025
e07c0a0
:white_check_mark: [#4980] Update tests
viktorvanwijk Jan 20, 2025
de22b21
:truck: [#4980] Make few functions public API
viktorvanwijk Jan 24, 2025
19c8ffc
:art: [#4980] Clean up post-processing
viktorvanwijk Jan 24, 2025
5e4c4e6
:truck: [#4980] Revise and move implementation of converting user-def…
viktorvanwijk Jan 24, 2025
5de478d
:truck: [#4980] Move implementation of JSON schema generation
viktorvanwijk Jan 24, 2025
b157657
:white_check_mark: [#4980] Update tests
viktorvanwijk Jan 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 [#4980] Add empty string to list of choices to account for an unfil…
…led field

Non-required fields can be empty upon submission, so need to include an empty string.
viktorvanwijk committed Jan 28, 2025
commit 1f8ee58e28269a05c7e75284ad751dad906b2aaf
3 changes: 3 additions & 0 deletions src/openforms/formio/components/vanilla.py
Original file line number Diff line number Diff line change
@@ -764,6 +764,7 @@ def as_json_schema(component: SelectComponent) -> JSONObject:
label = component.get("label", "Select")

choices = [options["value"] for options in component["data"]["values"]]
viktorvanwijk marked this conversation as resolved.
Show resolved Hide resolved
choices.append("") # Take into account an unfilled field

base = {"type": "string", "enum": choices}
if multiple:
@@ -845,6 +846,8 @@ def as_json_schema(component: RadioComponent) -> JSONObject:
label = component.get("label", "Radio")

choices = [options["value"] for options in component["values"]]
choices.append("") # Take into account an unfilled field

base = {"title": label, "type": "string", "enum": choices}

return base