Skip to content

fix(const-to-enum): handle boolean schema in properties#1845

Merged
cdklabs-automation merged 1 commit intomainfrom
mrgrain/fix/const-to-enum/handle-boolean-schema
Jan 6, 2026
Merged

fix(const-to-enum): handle boolean schema in properties#1845
cdklabs-automation merged 1 commit intomainfrom
mrgrain/fix/const-to-enum/handle-boolean-schema

Conversation

@mrgrain
Copy link
Copy Markdown
Contributor

@mrgrain mrgrain commented Jan 6, 2026

JSON Schema allows true as a shorthand for an empty schema that accepts any value. The constToEnum transformer was failing when encountering such boolean schemas in properties because the hasConst type guard assumed the input was always an object.

This adds a type check to handle boolean schemas gracefully, preventing runtime errors during transformation.


Ask Yourself

@cdklabs-automation cdklabs-automation added this pull request to the merge queue Jan 6, 2026
Merged via the queue into main with commit d850048 Jan 6, 2026
7 checks passed
@cdklabs-automation cdklabs-automation deleted the mrgrain/fix/const-to-enum/handle-boolean-schema branch January 6, 2026 14:32
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.

3 participants