-
Notifications
You must be signed in to change notification settings - Fork 26
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
missing HasOpenApi instance ? #17
Comments
Hi @teto, Are you sure you are using type Api = Get '[] (Headers '[Header "jinko-resource-type" String] NoContent)
openApi = toOpenApi (Proxy :: Proxy Api) For me this example generates the following openapi: {
"openapi": "3.0.0",
"info": {
"title": "",
"version":""
},
"paths": {
"/": {
"get": {
"responses": {
"200": {
"headers": {
"jinko-resource-type": {"schema": {"type": "string"}}
},
"description":""
}
}
}
}
},
"components": {}
} |
@maksbotan I'm not the original poster, but I'm seeing this error for my auth endpoints: type AuthAPI =
"register" :> ReqBody '[JSON] RegisterBody :> UVerb 'POST '[JSON] '[WithStatus 200 AuthResp, WithStatus 422 String]
:<|> "login"
:> ReqBody '[JSON] LoginBody
:> UVerb
'POST
'[JSON]
'[ WithStatus
200
( Headers
'[ Header "Set-Cookie" SetCookie,
Header "Set-Cookie" SetCookie
]
AuthResp
),
WithStatus 401 String
] Seems like there may be a missing instance around the UVerb instances when using headers. |
Can you show the precise error message generated with that code? And why do you have |
app/Main.hs:107:18: error:
• No instance for (ToSchema
(Headers
'[Header "Set-Cookie" SetCookie, Header "Set-Cookie" SetCookie]
AuthResp))
arising from a use of ‘toOpenApi’
• In the expression: toOpenApi authApi
In an equation for ‘authApiSwagger’:
authApiSwagger = toOpenApi authApi
|
107 | authApiSwagger = toOpenApi authApi I assume it's because |
when compiling my program I get a no instance error for:
Here are the versions:
I've tried looking into the code but there seemed to be several abstractions and I gave up. Maybe with some guidance I could try again.
The text was updated successfully, but these errors were encountered: