Skip to content

question: how to have uuid.UUID as type but still specify format: uuid in openapi spec? #3754

Description

@gabyx

We have this UUID field:

dsl.Field(0, "id", dsl.String, func() {
        // Serialize it with `uuid.UUID`.
        dsl.Meta("struct:field:type", "uuid.UUID", "github.com/google/uuid")

        // Some other stuff, for tags in GO...
        dsl.Meta("struct:tag:yaml", "id")
})

instead of

dsl.Field(0, "id", dsl.String, func() {
       // Use the string formatting checks.
       dsl.Format(dsl.FormatUUID)

        // Some other stuff, for tags in GO...
        dsl.Meta("struct:tag:yaml", "id")
})

The latter however nicely puts the format: uuid on the openapi spec.

Is there a way to hack that in as well for the first use case which is much more nice to use in Go?

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions