Skip to content

add ToSchema Schema instance  #92

Description

@teto

I am trying to return a Json schema in my servant endpoint.
I tried to derive generically ToSchema Schema but it failed because of orderedmaps
I tried a manual instance but it doesn't pass the openapi validators ofc.

instance ToSchema Schema where
  declareNamedSchema _ =
      pure $ NamedSchema Nothing $ mempty
        & properties .~ [
          ("required", Inline $ toSchema (Proxy @Int))
          , ("properties", Inline $ toSchema (Proxy @Int))
          , ("example", Inline $ mempty & type_ ?~ OpenApiObject)
          ]

I wish the instance would live in openapi3.

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