Skip to content

Fix validation problems#103

Merged
martin-fleck-at merged 7 commits intoeclipse-emfcloud:masterfrom
sgraband:patternFix
May 14, 2021
Merged

Fix validation problems#103
martin-fleck-at merged 7 commits intoeclipse-emfcloud:masterfrom
sgraband:patternFix

Conversation

@sgraband
Copy link
Copy Markdown
Contributor

@sgraband sgraband commented Apr 23, 2021

Before, if a model would contain a value that is not cohering to the
defined pattern facet, the ObjectMapper could not encode the diagnostic
properly because it ignored private fields. This is now fixed.

The validation/constraints endpoint now also returns constraints from extended features and does not send features without any constraints.

To test the pattern fix, the usecase described in #102. Was added to the validation test to assure this is working.

Fixes #102

Signed-off-by: Simon Graband sgraband@eclipsesource.com

Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Code looks good to me but could you please add a test case for this?

sgraband added 4 commits May 6, 2021 09:35
Before, if a model would contain a value that is not cohering to the
defined pattern facet, the ObjectMapper could not encode the diagnostic
properly because it ignored private fields. This is now fixed.

Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
The Deserializer did not set the severity not properly. This fixes that.

Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
Now the validation/constraints endpoint returns all of the constraints
for each type, as well as the parent types.

Also features with empty constraints are not send to the client anymore.

Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
Signed-off-by: Simon Graband <sgraband@eclipsesource.com>
Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Hi Simon, could you please also add some test cases for the retrieval of the validation constraints? I think:

  • Without constraints
  • With constraints
  • With constraints + parent constraints
  • With constraints + overwritten parent constraints (I believe the lowest in the hierarchy should probably be used).

Otherwise the change looks great, thank you!


}

public boolean hasConstraints() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This method produces two checkstyle warnings and leads to errors in the build: https://ci.eclipse.org/emfcloud/job/eclipse-emfcloud/job/emfcloud-modelserver/job/PR-103/11/checkstyle/new/

martin-fleck-at and others added 2 commits May 14, 2021 09:35
Signed-off-by: Simon Graband <sgraband@eclipsesource.com>

Co-authored-by: Martin Fleck <mfleck@eclipsesource.com>
Copy link
Copy Markdown
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Changes look good to me, thank you very much Simon!

@martin-fleck-at martin-fleck-at merged commit 3dd51b9 into eclipse-emfcloud:master May 14, 2021
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.

Adding a pattern validation causes exception

2 participants