Skip to content

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

@gabyx

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?

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