Skip to content

Skip StringLength attribute for date/time properties#1911

Open
lahma wants to merge 1 commit intoRicoSuter:masterfrom
lahma:fix/no-stringlength-on-datetime-1373
Open

Skip StringLength attribute for date/time properties#1911
lahma wants to merge 1 commit intoRicoSuter:masterfrom
lahma:fix/no-stringlength-on-datetime-1373

Conversation

@lahma
Copy link
Copy Markdown
Collaborator

@lahma lahma commented Mar 8, 2026

Summary

  • Do not emit [StringLength] on properties with date-time, date, or time format, as the attribute is only meaningful for string types
  • Previously, a schema with format: date-time and minLength/maxLength would generate a [StringLength] attribute on a DateTimeOffset property, which is semantically invalid

Fixes #1373

Test plan

  • New test: schema with format: date-time + minLength/maxLength does NOT emit [StringLength]
  • Existing [StringLength] tests for string properties still pass (13 tests total)

🤖 Generated with Claude Code

Do not emit [StringLength] on properties with date-time, date, or time
format, as the attribute is only meaningful for string types.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.

StringLentgthAttribute generates for DateTime properties

1 participant