Commit 7993de8
committed
Small change to Schema model to allow generated specs to be picklable
- 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.1 parent 1270d5a commit 7993de8
File tree
2 files changed
+6
-2
lines changed- openapi_core
- schema/schemas
- unmarshalling/schemas
2 files changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
70 | 74 | | |
71 | | - | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| |||
0 commit comments