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

Messages - Json Schema validation not working #1816

Open
madhurrya opened this issue Jun 25, 2024 · 5 comments
Open

Messages - Json Schema validation not working #1816

madhurrya opened this issue Jun 25, 2024 · 5 comments

Comments

@madhurrya
Copy link
Contributor

madhurrya commented Jun 25, 2024

I have added this under 'Json Schema'

{
  "$id": "https://example.com/blog-post.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "A representation of simple message",
  "properties": {
    "age": {
      "type": "number"
    },
    "name": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "age"
  ]
}

In the payload I have added this

{
    "name": "Chris",
    "email": "[email protected]"
  }

Since age is a required property I think it should show some error to the user. But the model runs without any issue.

temp-model-8-14.bpmn.txt

e.g.
https://mysql.spiffcrm.com/editor/process-models/misc:qa:bpmn-model-testing:unit-test-message-start-event-with-json-schema/files/unit-test-message-start-event-with-json-schema.bpmn
https://mysql.spiffcrm.com/editor/process-models/misc:qa:bpmn-model-testing:unit-test-message-end-event-with-json-schema/files/unit-test-message-end-event-with-json-schema.bpmn

@jasquat
Copy link
Contributor

jasquat commented Jun 25, 2024

@madhurrya was this sent to a message start event? Where is that form being used?

@madhurrya
Copy link
Contributor Author

@jasquat I didn't write a Receive part for this. Was just checking the validation works.

@jasquat
Copy link
Contributor

jasquat commented Jun 25, 2024

Oh I see. I misunderstood the issue. Yeah, I'm not sure if the validation has been implemented.

@jbirddog @danfunk how is this validation supposed to work? Run the validation in the MessageService when creating a message instance?

@jbirddog
Copy link
Contributor

Oh I see. I misunderstood the issue. Yeah, I'm not sure if the validation has been implemented.

@jbirddog @danfunk how is this validation supposed to work? Run the validation in the MessageService when creating a message instance?

That sounds right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issue
Development

No branches or pull requests

3 participants