From b9f801f974c66f6e260c6d33c40ca4981c3eed1a Mon Sep 17 00:00:00 2001 From: "Matthieu C." <886074+teto@users.noreply.github.com> Date: Fri, 7 Mar 2025 15:20:50 +0100 Subject: [PATCH] specify 'uuid' as format for UUID It's available in the registry: https://spec.openapis.org/registry/format/uuid which apparently doesn't mandate tools to support it but even then, if they dont recognize the format, they must fallback on the type so this change should be a plus with no negative effects. --- src/Data/OpenApi/Internal/Schema.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Data/OpenApi/Internal/Schema.hs b/src/Data/OpenApi/Internal/Schema.hs index da56acf0..0cccf66e 100644 --- a/src/Data/OpenApi/Internal/Schema.hs +++ b/src/Data/OpenApi/Internal/Schema.hs @@ -636,6 +636,7 @@ instance ToSchema () where instance ToSchema UUID.UUID where declareNamedSchema p = pure $ named "UUID" $ paramSchemaToSchema p & example ?~ toJSON (UUID.toText UUID.nil) + & format ?~ "uuid" instance (ToSchema a, ToSchema b) => ToSchema (a, b) where declareNamedSchema = fmap unname . genericDeclareNamedSchema defaultSchemaOptions