Skip to content

Expose typed string enum metadata - #6

Merged
ChiragAgg5k merged 2 commits into
mainfrom
feat/open-string-enum-metadata
Aug 20, 2026
Merged

Expose typed string enum metadata#6
ChiragAgg5k merged 2 commits into
mainfrom
feat/open-string-enum-metadata

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

Summary

  • expose enum names and keys as typed StringSchema properties
  • mark enum branches from open string-enum composites with typed open metadata
  • keep open-enum shape recognition in CompositeSchema

Tests

  • composer lint
  • vendor/bin/phpunit tests/Schema/ReaderTest.php
  • composer format:check
  • composer rector:check

@greptile-apps

greptile-apps Bot commented Aug 20, 2026

Copy link
Copy Markdown

Greptile Summary

The PR exposes typed string-enum metadata and marks recognized open-enum branches with typed open metadata.

  • Adds enumName, validated enumKeys, and open properties to StringSchema.
  • Preserves open string-enum recognition within CompositeSchema.
  • Adds parser and model coverage for metadata validation and branch ordering.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported enum-key type violation is fixed by validating every x-enum-keys element before assigning it to the typed model, and no blocking failure remains.

Important Files Changed

Filename Overview
src/Parser/Schema/Reader.php Parses enum names and validates every enum-key element as a string, fully addressing the prior review finding.
src/Parser/Value.php Adds list-level string validation with index-specific specification errors.
src/Model/StringSchema.php Exposes enum name, typed enum keys, and open-enum status on string schemas.
src/Model/CompositeSchema.php Marks the recognized enum branch as open while preserving all existing StringSchema fields.
tests/Schema/ReaderTest.php Covers enum metadata propagation, open status, and both branch orders.
tests/ValueTest.php Verifies valid string lists and rejection of non-string elements.

Reviews (2): Last reviewed commit: "fix: validate enum key values" | Re-trigger Greptile

Comment thread src/Parser/Schema/Reader.php Outdated
@ChiragAgg5k
ChiragAgg5k merged commit fa12ba2 into main Aug 20, 2026
5 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the feat/open-string-enum-metadata branch August 20, 2026 15:21
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