Describe the bug
Very similar to #1615 but for msgspec.Struct output format
To Reproduce
Example schema:
openapi: 3.1.0
info:
title: Bug report
version: 0.0.1
paths:
/api:
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/Model'
description: ''
components:
schemas:
Model:
type: object
properties:
updated:
type: string
format: date-time
start:
type: string
format: date
Used commandline:
$ datamodel-codegen --input openapi.yaml --output models.py --output-model-type msgspec.Struct --input-file-type openapi
Expected behavior
class Model(Struct):
updated: Optional[datetime] = None
start: Optional[date] = None
Instead right now they come out as str
types.
Version:
Additional context
Add any other context about the problem here.
I'm happy to attempt a PR if you'd like me to
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too