feat(api): add unknown severity field and enum value#110
Conversation
Add `unknown` integer property to SourceSummary schema and `UNKNOWN` value to the Severity enum. This enables counting vulnerabilities with no CVSS score or severity classification. Update SeverityUtilsTest to reflect that "unknown" is now a valid severity value. Implements TC-4723 Assisted-by: Claude Code
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds an File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #110 +/- ##
============================================
+ Coverage 94.89% 95.00% +0.10%
- Complexity 34 35 +1
============================================
Files 4 4
Lines 98 100 +2
Branches 8 9 +1
============================================
+ Hits 93 95 +2
Misses 4 4
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Change fromScore parameter from primitive float to boxed Float so callers can pass null when no CVSS score is available, returning Severity.UNKNOWN instead of forcing a default numeric value. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Verification Report for TC-4723 (commit 75dbb13)
Overall: WARNScope Containment flagged 2 files not listed in the task's "Files to Modify" section ( This comment was AI-generated by sdlc-workflow/verify-pr v0.9.2. |
Summary
unknowninteger property (default0) to theSourceSummaryschema in the v5 OpenAPI spec, positioned afterlowand beforeremediations, to count vulnerabilities with no CVSS score or severity classificationUNKNOWNvalue to theSeverityenum afterLOWSeverityUtilsTestto validateUNKNOWNas a valid severity value instead of rejecting itTest plan
npx @redocly/cli lint api/v5/openapi.yamlvalidationmvn packagesucceeds with all tests passing (25 tests)SourceSummary.javahasgetUnknown()/setUnknown()methodsSourceSummary.tshasunknown?: numberfieldSeverity.javahasUNKNOWNenum constantSeverity.tshasUnknown = 'UNKNOWN'entryImplements TC-4723
Summary by Sourcery
Add support for an UNKNOWN severity level and an unknown vulnerability count in the v5 API schema and utilities.
New Features:
Tests: