-
Notifications
You must be signed in to change notification settings - Fork 18
Add an OpenAPI 3 Serializer #468
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added just a note about the async interface. I guess we do callbacks for consistency which is a good thing so no need to change.
Perhaps we introduce synchronous API for everything that could be done synchronously later on.
fury.use(openapi3Serializer); | ||
|
||
// Assume `api` is a Minim element instance, e.g. from `fury.parse(...)` | ||
fury.serialize({ api, mediaType: 'application/vnd.oai.openapi' }, (error, content) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd expect the serialize
would be synchronous for easy of use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parse
and serialize
functions in Fury are async. As we provide a uniform interface for serializing regardless of format and adapter implementation. This includes the "remote" adapter which uses HTTP to parse/serialize this could be problematic to support them all as sync.
I don't have much strong opinions against or for this, so if you would like sync API we can create an issue in the repository to investigate support across all the adapters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, master has sync interface for serialize now. We can support it here 😄.
Hey 👋 , might I ask what's the status of this PR? Thank you 👍 |
This is more of a proof of concept, I'm not sure we'll pursue this any further. |
Initial proof of concept with numerous caveats and unsupported elements (tracked in STATUS.md).