Is there any provision to pickle spec
Hi @jugaadi
Can you provide more details on the topic. Which kind of pickle spec provision in openapi-core you looking for?
If you need to support serializing / deserializng Python objects via something like,
components:
schemas:
PickleData:
type: "string"
format: "pickle"
it in theory possible by providing custom formatter to request / response validator.
But it may lead into a problems if your OpenAPI schema will be shared with other services, which don't know about given pickle format.
With that in mind, I'd suggest you to do pickle/unpickle by yourself and use binary strings for those data,
components:
schemas:
BinaryData:
type: "string"
format: "binary"
Thanks @playpauseandstop for the response. I tried pickle'ing the result of openapi_core.create_spec() without any success.
My primary motive is to pickle the entire spec to reduce the time taken to parse the openapi spec(json).
Ouch @jugaadi, I've thought about completely different thing 😄
Not sure about your implementation details, but what about instantiating spec once at app startup and then reuse that instance at runtime?
Not sure about your implementation details, but what about instantiating spec once at app startup and then reuse that instance at runtime?
That's how we are currently handling it.