Repository navigation
feat!: add schema union support - #785
jonaslagoni wants to merge 7 commits into
Conversation
|
@jonaslagoni You shouldn't remove the EDIT: Ok, you removed from message trait - but if there's a possibility to have that value in v2 message's trait, the v2 should return that, in v3 we should return |
fmvilas
left a comment
There was a problem hiding this comment.
Looks good to me in general. Left a minor comment.
| const payloadIsSchemaUnion = this._json.payload.schemaFormat !== undefined; | ||
| return payloadIsSchemaUnion ? this._json.payload.schemaFormat : getDefaultSchemaFormat(this._meta.asyncapi.semver.version); |
There was a problem hiding this comment.
| const payloadIsSchemaUnion = this._json.payload.schemaFormat !== undefined; | |
| return payloadIsSchemaUnion ? this._json.payload.schemaFormat : getDefaultSchemaFormat(this._meta.asyncapi.semver.version); | |
| const payloadIsSchemaUnion = this._json.payload?.schemaFormat !== undefined; | |
| return payloadIsSchemaUnion ? this._json.payload.schemaFormat : getDefaultSchemaFormat(this._meta.asyncapi.semver.version); |
I think payload can be undefined, right? We should be careful then.
| schema: AsyncAPISchemaObject | ReferenceObject | any; | ||
| } | ||
|
|
||
| export type AllSchemaObjects = MultiFormatSchemaObject | AsyncAPISchemaObject | ReferenceObject | any; |
There was a problem hiding this comment.
About naming: asyncapi/spec-json-schemas#370 (comment)
smoya
left a comment
There was a problem hiding this comment.
Looks pretty good to me! Just few changes that are needed. Including the one @fmvilas requested in https://github.com/asyncapi/parser-js/pull/785/files#r1242462994
|
I'm taking over this one as @jonaslagoni is 🌴 🏖️ |
|
Required Parser-API changes are now in the following PR asyncapi/parser-api#100 |
|
Kudos, SonarCloud Quality Gate passed! |
|
Since this PR has been opened for a while and lot of changes come from cc @jonaslagoni |








Description
This PR adds support for schema union support.
Related issue(s)
Related to asyncapi/spec#622
Fixes #809