You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
String with uuid format shoud generate an UUID #599
Is your feature request related to a problem? Please describe.
It would be safer to generate UUID instances instead of str instances if the property is defined as a string with a format uuid.
Describe the solution you'd like
At the moment the property that is defined as:
type: string
format: uuid
is generated with type str. I would like such property to be generated with the type UUID.
I worry this might create a bug in any clients which are expecting a UUID version not supported by the Python standard library (e.g., uuid7 which is increasingly used for database primary keys). I wonder if we should only attempt to coerce formats which indicate the version of uuid? We could also fall back to str at runtime, but that just means everyone has to type-check at runtime.
Activity
dbanty commentedon Aug 13, 2023
I worry this might create a bug in any clients which are expecting a UUID version not supported by the Python standard library (e.g., uuid7 which is increasingly used for database primary keys). I wonder if we should only attempt to coerce formats which indicate the version of uuid? We could also fall back to
strat runtime, but that just means everyone has to type-check at runtime.