FWI-5232 Conditional expressions should be at very top of additionalSchemaStrings #1025
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #1003
Checklist
Description
Polaris checks utilize
additionalSchemaStrings
, an additional section of jsonschema that will only evaluate if the object conforms toschemaString
. The conditional statements inadditionalSchemaStrings
need to be arranged in a manner such that when there's nothing to evaluate, the string is empty (not the object therein).What's the goal of this PR?
Fix false positives reported when running the Polaris CLI for the following checks:
What changes did you make?
adjust the ordering of conditional expressions in
additionalSchemaStrings
:e.g.
so that there is not an empty object being evaluated, but rather an empty string
I've also added success test cases as a regression check
What alternative solution should we consider, if any?