Skip to content

Add DateTime detection for OpenAPI date-time format#34

Open
tomasvanrijsse wants to merge 1 commit intocrescat-io:masterfrom
Timatic:datetime-properties
Open

Add DateTime detection for OpenAPI date-time format#34
tomasvanrijsse wants to merge 1 commit intocrescat-io:masterfrom
Timatic:datetime-properties

Conversation

@tomasvanrijsse
Copy link
Copy Markdown
Contributor

Detect and map OpenAPI string fields with format: "date-time" to \Carbon\Carbon type hints in generated DTOs. This provides better type safety and IDE autocomplete for datetime properties.

Changes:

  • Modified DtoGenerator::mapType() to check for date-time format
  • String fields with format: "date-time" now generate \Carbon\Carbon type
  • Nullable datetime fields generate ?\Carbon\Carbon

This implementation relies only on the OpenAPI specification (format field) rather than property naming conventions.

Related to Phase 1, PR #2 of generator improvements.

Detect and map OpenAPI string fields with format: "date-time" to
\Carbon\Carbon type hints in generated DTOs. This provides better
type safety and IDE autocomplete for datetime properties.

Changes:
- Modified DtoGenerator::mapType() to check for date-time format
- String fields with format: "date-time" now generate \Carbon\Carbon type
- Nullable datetime fields generate ?\Carbon\Carbon

This implementation relies only on the OpenAPI specification
(format field) rather than property naming conventions.

Related to Phase 1, PR crescat-io#2 of generator improvements.

Co-Authored-By: Claude Sonnet 4.5 <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.

1 participant