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

toOpenApi api never finishes compilation, split up version does #8

Open
KasperJanssens opened this issue Mar 26, 2021 · 1 comment
Open

Comments

@KasperJanssens
Copy link

Hello,

I created an Api in servant and tried to get the servant-openapi3 library to generate openapi json from it. The api has 13 resources so it's not extremely large but I notice that the openapi generation hangs or at least takes a really really long time to finish ( let it run for over two hours and it still did not finish). When I split up the api in smaller subapis, of about max four resources and paste them back together in an overarching api compilation finishes in a matter of seconds.

I created a test project, using stack, ghc 8.10.4, most of the other versions and infos can likely be discerned from the repo, if not just ask and I will provide.

In that test project you can find two files, the TestApiSplitUp which finishes compilation and the TestApi which does not. Commenting out the toOpenApi statement makes the compilation finish so fairly sure that is the issue.

Kasper

@jumper149
Copy link

A solution that works for me, is by moving the toOpenApi call into a separate module and to that module I added:

{-# OPTIONS_GHC -O0 #-}

This way I didn't have to touch the actual API.

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

2 participants