Skip to content

String with uuid format shoud generate an UUID #599

Description

@RockyMM

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.

Activity

  1. dbanty commented on Aug 13, 2023

    @dbanty
    Collaborator

    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.

  2. locked and limited conversation to collaborators on Aug 13, 2023
  3. converted this issue into a discussion #817 on Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions