Closed
Description
Describe the bug
I am creating an OAS3 file from an existing API and one of the schemas includes a property named datetime
which causes an Attribute exception when the generated model is imported.
To Reproduce
Steps to reproduce the behavior:
- Convert a OAS3 file that contains a property named datatime:
- Conversion succeeds with no errors or warnings
- When executing generated code that has the offending model imported, an AttributeError will be thrown with message:
'Unset' object has no attribute 'datetime'
Expected behavior
A typed named datetime
should be renamed with an underscore suffix like other built-in types
OpenAPI Spec File
components:
schemas:
fubar:
type: object
properties:
datetime:
type: string
format: date-time
Desktop (please complete the following information):
- OS: macOS 12.1
- Python Version: 3.9.6
- openapi-python-client version 0.10.8
Additional context
This looks like a simple fix. I'll work on a PR.