json_schema icon indicating copy to clipboard operation
json_schema copied to clipboard

Avoid nullable `schemaPath` and `instancePath`

Open jonasfj opened this issue 1 year ago • 1 comments

Ultimate problem:

schemaPath and instancePath on ValidationError is never null, so users shouldn't need to check for null.

How it was fixed:

schemaPath and instancePath was made non-nullable.

Testing suggestions:

N/A.

Potential areas of regression:

nits:

  • Users who access schemaPath or instancePath may get a warning, if they were doing null checks (most probably where). This warning is likely harmless and easy to fix by removing the unnecessary null check.
  • Users who made a class that implements ValidationError may rely on instancePath and schemaPath being nullable. However:
    • It's unlikely that implementing ValidationError is common (the constructor is private, so it was probably not intended for subclassing).
    • ValidationError should probably be a made a final class ValidationError.

jonasfj avatar Sep 21 '24 20:09 jonasfj

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

aviary-wf avatar Sep 21 '24 20:09 aviary-wf

@Workiva/release-management-p

michaelcarter-wf avatar Oct 17 '24 15:10 michaelcarter-wf