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

feat: add feel property #46

Merged
merged 2 commits into from
Mar 14, 2022
Merged

feat: add feel property #46

merged 2 commits into from
Mar 14, 2022

Conversation

marstamm
Copy link
Member

@marstamm marstamm self-assigned this Mar 11, 2022
@bpmn-io-tasks bpmn-io-tasks bot added the in progress Currently worked on label Mar 11, 2022
@marstamm
Copy link
Member Author

@pinussilvestrus, I tried out to implement the rule "Feel is only valid for type String and Text" and actually got it to work 😄
Could you give it a quick check whether using if/then together with not is the correct approach here? Maybe there is a more elegant approach that I am not aware of yet

relevant lines: https://github.com/camunda/element-templates-json-schema/pull/46/files#diff-94dce962273655c5b1774e11a13b912d8316a6ef64bfb0ea0610a645de92ea18R30-R53

Copy link
Contributor

@pinussilvestrus pinussilvestrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good basically. If you want to, I could do another try on Monday whether we can make the rule a bit more readable. 👍

@marstamm
Copy link
Member Author

Thank you for the feedback! I will look into this on monday and come back to you if it does not work

@pinussilvestrus
Copy link
Contributor

Maybe something like this (using a similar pattern as for optional)

{
  "if": {
    "properties": {
      "feel": {
        "not": {
          "const": null
        }
      }
    },
    "required": [
      "feel"
    ]
  },
  "then": {
    "properties": {
      "type": {
        "enum": [
          "String",
          "Text"
        ],
        "errorMessage": "feel is only valid for \"String\" and \"Text\" type"
      }
    },
    "required": [
      "type"
    ]
  }
}

@marstamm
Copy link
Member Author

Thank you for the feedback! I changed the PR accordingly. Ready for review again

@marstamm marstamm marked this pull request as ready for review March 14, 2022 09:00
@bpmn-io-tasks bpmn-io-tasks bot added needs review Review pending and removed in progress Currently worked on labels Mar 14, 2022
Copy link
Contributor

@pinussilvestrus pinussilvestrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@merge-me merge-me bot merged commit a950c47 into master Mar 14, 2022
@merge-me merge-me bot deleted the json-schema-feel branch March 14, 2022 09:02
@bpmn-io-tasks bpmn-io-tasks bot removed the needs review Review pending label Mar 14, 2022
@pinussilvestrus
Copy link
Contributor

@marstamm fyi: I squashed the two commits together on master, to ensure we don't have changes on sub packages that shouldn't have some. Only zeebe-element-templates-json-schema should be affected. This way it should make it easier for lerna to only release changed packages on npm run release 👍 .

@marstamm
Copy link
Member Author

Thank you for the heads up. #45 changed the examples and titles of everything, so we will release patches for shared and camunda schema anyway 😄

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

Successfully merging this pull request may close these issues.

2 participants