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

Is there anyway to (de)serialize an OpenAPI object? #4338

Open
SilverLiningSL opened this issue Dec 28, 2022 · 3 comments
Open

Is there anyway to (de)serialize an OpenAPI object? #4338

SilverLiningSL opened this issue Dec 28, 2022 · 3 comments

Comments

@SilverLiningSL
Copy link

SilverLiningSL commented Dec 28, 2022

For some reason, I'm using swagger-parser to parse Json to OpenAPI object. However, the json-string is pretty large (about 1MB), it takes about half a minute to analyze it every time, so I want to cache the OpenAPI object in some way. But the OpenAPI class itself does not implement serializable, so I can't do in in native way. Is there any tool for me to realise this?

@pjfanning
Copy link
Contributor

Why don't you cache the json-string yourself?

@alexanderankin
Copy link

Jackson supports jdk serialization, so you can try something like this

@SilverLiningSL
Copy link
Author

Why don't you cache the json-string yourself?

I surely can, but the problem is the deserialization procedure from json-string to OpenAPI object cost much longer time than reading the json-string, which is where I want to do the optimization.

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

3 participants