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

fix: ruleset path for Example Object validation #882

Merged
merged 2 commits into from
Jan 6, 2020
Merged

fix: ruleset path for Example Object validation #882

merged 2 commits into from
Jan 6, 2020

Conversation

johlo
Copy link
Contributor

@johlo johlo commented Jan 1, 2020

The example field has Any values in all contexts
it can be used so the rule should not be triggered for that field.

The examples field always has values of Example Object type in
all contexts, so this is what the rule should trigger on.
And since the examples field takes a map of example objects
the JSON path expression needs the final .* to work.

Updated the tests to validate examples field instead of example and added
one test.

Checklist

  • Tests added / updated
  • Docs added / updated

Does this PR introduce a breaking change?

  • Yes
  • No

@nulltoken
Copy link
Contributor

@johlo Looks pretty cool, thanks!

Next to the newly added test validate multiple valid examples, would you mind adding some additional ones to cover the following use cases?

  • multiple examples with one of them exposing both value and externalValue
  • multiple examples with one of them exposing neither value nor externalValue

The 'example' field has 'Any' values in all contexts
it can be used so the rule should not be triggered for that field.

The 'examples' field always has values of Example Object type in
all contexts, so this is what the rule should trigger on.

Changed tests to validate `examples` instead of `example` and added
additional tests with multiple examples below the `examples` field.
@johlo
Copy link
Contributor Author

johlo commented Jan 2, 2020

* multiple examples with one of them exposing both `value` and `externalValue`

* multiple examples with one of them exposing neither `value` nor `externalValue`

Done, amended to the old commit.

@johlo
Copy link
Contributor Author

johlo commented Jan 2, 2020

btw, when preparing this PR I've only run the yarn test.prod tests, I couldn't run yarn test.harness since yarn build.binary fails to build the binary (because I'm using node 13.5?).

@nulltoken
Copy link
Contributor

Done, amended to the old commit.

@johlo 👍

@P0lip Could you please take a look?

Copy link
Contributor

@P0lip P0lip left a comment

Choose a reason for hiding this comment

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

Thanks!

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

4 participants