Skip to content

Commit

Permalink
🚧 [#4908] Add hard-coded schema to result dict in json registration p…
Browse files Browse the repository at this point in the history
…lugin

Just as an example of what will be implemented in #4980
  • Loading branch information
viktorvanwijk committed Jan 2, 2025
1 parent 241f03c commit 465ec1b
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/openforms/registrations/contrib/json/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,33 @@ def register_submission(self, submission: Submission, options: JSONOptions) -> d
}
)

# Generate schema
# TODO: will be added in #4980. Hardcoded example for now.
schema = {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"static_var_1": {
"type": "string",
"pattern": "^cool_pattern$"
},
"form_var_1": {
"type": "string"
},
"form_var_2": {
"type": "string"
},
"attachment": {
"type": "string",
"contentEncoding": "base64"
},
},
"required": ["static_var_1", "form_var_1", "form_var_2"],
"additionalProperties": False,
}

# Send to the service
json = {"values": values}
json = {"values": values, "schema": schema}
service = options["service"]
submission.registration_result = result = {}
with build_client(service) as client:
Expand Down

0 comments on commit 465ec1b

Please sign in to comment.