Skip to content

Small change to Schema model to allow generated specs to be picklable #243

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

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

Beirdo
Copy link
Contributor

@Beirdo Beirdo commented Apr 19, 2020

  • overriding dict is death for pickling. I renamed it to newdict
    and tweaked the one user of it, and now this part of the structure is
    working fine for pickling
  • there are also upstream changes in jsonschema that need to be in for the
    overall success
  • this allows me to create the API spec from a swagger file once (which takes
    2-20s for the files I'm working with), and cache the result as a pickle file
    for loading on the next startup (assuming the swagger file hasn't been
    updated). The load from pickle files takes 2-5ms. This is an improvement
    of load time by 3 orders of magnitude.

Beirdo added 2 commits April 19, 2020 13:08
- overriding __dict__ is death for pickling.   I renamed it to __newdict__
  and tweaked the one user of it, and now this part of the structure is
  working fine for pickling
- there are also upstream changes in jsonschema that need to be in for the
  overall success
- this allows me to create the API spec from a swagger file once (which takes
  2-20s for the files I'm working with), and cache the result as a pickle file
  for loading on the next startup (assuming the swagger file hasn't been
  updated).  The load from pickle files takes 2-5ms.  This is an improvement
  of load time by 3 orders of magnitude.
@p1c2u p1c2u merged commit 1583454 into python-openapi:master Jul 20, 2020
p1c2u added a commit that referenced this pull request Jul 20, 2020
This reverts commit 1583454, reversing
changes made to 8bbdb59.
p1c2u added a commit that referenced this pull request Jul 20, 2020
mgaeta pushed a commit to getsentry/openapi-core that referenced this pull request Sep 23, 2020
This reverts commit 1583454, reversing
changes made to 8bbdb59.
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

Successfully merging this pull request may close these issues.

2 participants