Skip to content

fix: AIFW-21697: GetMCPServerScanReportRequest does not enforce filter_options as required - #6

Draft
vokit-cisco wants to merge 1 commit into
mainfrom
AIFW-21697-GetMCPServerScanReportRequest-does-not-enforce-filter_options-as-required
Draft

fix: AIFW-21697: GetMCPServerScanReportRequest does not enforce filter_options as required#6
vokit-cisco wants to merge 1 commit into
mainfrom
AIFW-21697-GetMCPServerScanReportRequest-does-not-enforce-filter_options-as-required

Conversation

@vokit-cisco

@vokit-cisco vokit-cisco commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes AIFW-21697 by enforcing required validation in MCP scan report request models.

This change makes missing filter inputs fail fast at model validation time, so invalid payloads are caught before request execution.

Changes

  • Made FilterOptions.capability_type required (changed from optional to required).
  • Made GetMCPServerScanReportRequest.filter_options required (changed from optional to required).
  • Added negative validation tests:
    • FilterOptions without capability_type raises ValidationError.
    • GetMCPServerScanReportRequest without filter_options raises ValidationError.
    • GetMCPServerScanReportRequest with empty filter_options raises ValidationError.

Test Plan

  • Unit tests pass in test_mcp_scan_base.py (88/88).
  • Validation path confirmed for missing capability_type.
  • Validation path confirmed for missing filter_options.
  • Validation path confirmed for empty filter_options object.

Compatibility Notes

  • Behavioral tightening: client code must now provide filter_options and capability_type when building scan report requests.
  • Expected impact: integrations that relied on omitted filter fields will now fail validation and should be updated accordingly.

…r_options as required

Signed-off-by: Volodymyr Kit <vokit@cisco.com>
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.

1 participant