http-spec
http-spec copied to clipboard
fix(oas): prevent duplicate null values in enum array [ISSUE-271]
Motivation and Context
null is always appended to enum array for nullable enum property. This can result in an invalid JSON schema document when null is already included as part of the enum array.
#271
Description
Checks for a null value in the enum array before appending one.
How Has This Been Tested?
Updated the OAS test fixture in f77dcf83d4964d6ba1c1c5291448fe839a35d436 to demonstrate issue in resultant snapshots.
Fix can be observed in 7452a4b394ebe0403dadeed8edee3b60a5763df7 where invalid null values are no longer present.
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] This PR's code follows as closely as possible the coding style/guidelines of this project.
- [ ] I have added error reporting and followed the error reporting guidelines.
- [ ] I have added event tracking and followed the event tracking guidelines.
- [x] I have updated any relevant documentation accordingly to reflect this PR's changes.
- [x] I have added automated tests (unit/integration/e2e/other) to cover my changes.
- [x] All new and existing tests pass locally (excluding flaky CI tests).
Hi @mnaumanali94! Any chance of getting some 👀 on this?