Conversation
…-e2e-432 # Conflicts: # src/apitypes/async/async.changes.ts
…-e2e-432 # Conflicts: # src/apitypes/async/async.operation.ts # src/types/internal/operation.ts
|
|
||
| if (!action || !channelRef) { | ||
| const { action, channel: operationChannel } = operationObject | ||
| if (!action || !operationChannel) { |
There was a problem hiding this comment.
what about messages? we consider message-driven operations, don't we?
There was a problem hiding this comment.
changes - out of scope. This code will either stay to rewrite it or it will go away altogether.
| apiType: ASYNCAPI_API_TYPE, | ||
| apiKind: calculateAsyncApiKind(operationApiKind, channelApiKind), | ||
| deprecated: !!message[ASYNCAPI_DEPRECATION_EXTENSION_KEY], | ||
| title: message.title || messageId, |
There was a problem hiding this comment.
Design
APIHUB Operation title(message.title). If the message has no title, the system shall display the messageId.
| const protocol = extractProtocol(channel) | ||
| // todo Get channelId and messageId. A new api-unifier is awaiting | ||
| const channelId = 'channelId' | ||
| const messageId = 'messageId' |
| // If there are not enough operations, we will get an incorrect result. | ||
| for (const key of operationKeys) { | ||
| if (!refsOnlyOperations[key]) { | ||
| return resultSpec |
There was a problem hiding this comment.
should we exit, not just skip?
There was a problem hiding this comment.
If there is not enough data in refsOnlyOperations, then we will get an uncorrected document
|
|
||
| for (const message of messages) { | ||
| if (!isObject(message)) { | ||
| continue |
There was a problem hiding this comment.
I believe this is redundant
| } | ||
|
|
||
| function isServerObject(server: AsyncAPIV3.ServerObject | AsyncAPIV3.ReferenceObject): server is AsyncAPIV3.ServerObject { | ||
| return isObject(server) && 'protocol' in server |
There was a problem hiding this comment.
isObject + !('$ref' in server')
| } | ||
|
|
||
| function isTagObject(item: AsyncAPIV3.TagObject | AsyncAPIV3.ReferenceObject): item is AsyncAPIV3.TagObject { | ||
| return (item as AsyncAPIV3.TagObject).name !== undefined |
| } | ||
|
|
||
| function isExternalDocumentationObject(item: AsyncAPIV3.ExternalDocumentationObject | AsyncAPIV3.ReferenceObject): item is AsyncAPIV3.ExternalDocumentationObject { | ||
| return (item as AsyncAPIV3.ExternalDocumentationObject).url !== undefined |
There was a problem hiding this comment.
btw, possibly it's better to make function isReferenceObject and just use it here
|
|
||
| return normalize(item, { | ||
| source: data, | ||
| }) as AsyncAPIV3.TagObject |
There was a problem hiding this comment.
shouldn't it be already normalized at this moment?
There was a problem hiding this comment.
I'll answer it. No, this is before the normalization stage, when preparing the document.
| ? externalDocs | ||
| : normalize(externalDocs, { | ||
| source: data, | ||
| }) as AsyncAPIV3.ExternalDocumentationObject |
There was a problem hiding this comment.
shouldn't it be already normalized at this moment?
No description provided.