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

feature(core) Stricter validation for atomic values #161

Merged

Conversation

jeromesimeon
Copy link
Member

@jeromesimeon jeromesimeon commented Dec 12, 2019

Signed-off-by: Jerome Simeon jeromesimeon@me.com

Issue #157 & #158

A stricter validation/serialization semantics for atomic types and values in CTO models.

Changes

  • Request CTO validation is not working #157 Atomic values in the JSON have to be strictly of the type declared in the model. E.g., true validates against Boolean but "true" does not. E.g., 3.14 validates against Double but does not validate against Integer or Long. E.g., "1" validates against String but 1 does not.
  • Serialization of Infinity is null #158 Serializing non-finite Doubles (NaN or Infinity or -Infinity) throws a validation error
  • Updates the tests accordingly

Flags

  • This is a breaking change
  • The PR is against a new release-0.83 branch

Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
Copy link
Sponsor Contributor

@dselman dselman left a comment

Choose a reason for hiding this comment

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

We should add removing the "ergo" stuff that snuck into Concerto v1 imo...

@jeromesimeon
Copy link
Member Author

We should add removing the "ergo" stuff that snuck into Concerto v1 imo...

We should definitely discuss how we want that to work, from a code-base / feature perspective!

@jeromesimeon
Copy link
Member Author

We should add removing the "ergo" stuff that snuck into Concerto v1 imo...

This is somewhat orthogonal to this specific PR and issue. I opened a new issue to track the "ergo stuff removal" here: #162

Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
…rror accordproject#158

Signed-off-by: Jerome Simeon <jeromesimeon@me.com>
@jeromesimeon jeromesimeon merged commit 4e0a6cb into accordproject:release-0.83 Dec 19, 2019
@jeromesimeon jeromesimeon deleted the js-fix-validation-157 branch December 19, 2019 16:07
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.

None yet

3 participants