Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ToSchema Schema instance #92

Open
teto opened this issue Feb 13, 2024 · 0 comments
Open

add ToSchema Schema instance #92

teto opened this issue Feb 13, 2024 · 0 comments

Comments

@teto
Copy link

teto commented Feb 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant