Skip to content

Validate open enum metadata - #7

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/string-enum-metadata-validation
Aug 20, 2026
Merged

Validate open enum metadata#7
ChiragAgg5k merged 1 commit into
mainfrom
fix/string-enum-metadata-validation

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

  • preserve typed enum metadata for Swagger 2 inline parameters
  • reject partial enum-key mappings
  • only recognize truly unrestricted string branches as open enums

Tests

  • composer check

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

The PR strengthens enum metadata handling and open-enum classification.

  • Preserves typed enum metadata on Swagger 2 inline parameters and headers.
  • Rejects x-enum-keys lists whose length differs from the corresponding enum.
  • Prevents constrained string branches and constrained composites from being classified as open enums.
  • Adds regression coverage for metadata preservation, validation, and open-enum constraints.

Confidence Score: 5/5

The PR appears safe to merge, with its stricter validation and open-enum classification matching the stated behavior.

The changed parser preserves the intended metadata, validates its positional mapping, and avoids marking constrained unions as open without introducing a concrete reachable failure.

Important Files Changed

Filename Overview
src/Model/CompositeSchema.php Tightens open-string-enum detection by excluding constrained branches and composites with top-level enum or not constraints; no actionable defect found.
src/Parser/Schema/Reader.php Preserves Swagger 2 inline enum metadata and enforces one enum key per enum value; behavior matches the stated validation contract.
tests/Schema/ReaderTest.php Adds focused coverage for inline metadata, mismatched enum keys, and constrained open-enum branches.

Reviews (1): Last reviewed commit: "fix: validate open enum metadata" | Re-trigger Greptile

@ChiragAgg5k
ChiragAgg5k merged commit a69a897 into main Aug 20, 2026
5 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/string-enum-metadata-validation branch August 20, 2026 15:59
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