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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with large OpenAPI files #152

Open
jaredmoody opened this issue Dec 9, 2022 · 1 comment
Open

Working with large OpenAPI files #152

jaredmoody opened this issue Dec 9, 2022 · 1 comment

Comments

@jaredmoody
Copy link

jaredmoody commented Dec 9, 2022

Hi @notEthan!

I'm evaluating using scorpio for a work project and got stuck pretty early. The OpenAPI JSON document I'm wanting to consume is quite large - 6.6MB of JSON 馃槼 - and just trying to load this class hangs indefinitely.

module ConnectWise
  class Resource < Scorpio::ResourceBase
    self.openapi_document = JSON.load(Rails.root.join('docs/connect_wise.json'))
  end
end

I assume Scorpio is trying to generate a lot of code at once when that's loaded.

Do you have general recommendations here? I only need a small subset of the API that the document defines - should I delete everything from the OpenAPI document I'm not using? Is there something I could do differently to lazy-load/generate only what I need?

Thanks!

@notEthan
Copy link
Owner

notEthan commented Dec 9, 2022

Unfortunately, the poor performance of Scorpio (really JSI, but effectively both) on large documents is one of the two big hurdles I'm working through before declaring these libraries as v1.0 production-ready things. I have a rough prototype working that fixes this and makes performance many orders of magnitude better. But at the moment it is only a prototype and needs a good bit more work before being generally usable. It's getting there, but I am not so good at estimating the time it will take to be ready for release.

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