- 
                Notifications
    
You must be signed in to change notification settings  - Fork 22
 
test(ns-asyncapi-3): add tests for AsyncAPI 3 namespace #5039
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
base: feat/OSS-247-namespace-for-apidom-ns-async-api-3
Are you sure you want to change the base?
test(ns-asyncapi-3): add tests for AsyncAPI 3 namespace #5039
Conversation
| 
               | 
          ||
| return FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement); | ||
| } | ||
| const result = FixedFieldsVisitor.prototype.ObjectElement.call(this, objectElement); | 
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.
Handling of Multi Format Schema based on MessageVisitor from AsyncAPI 2 namespace.
| * @public | ||
| */ | ||
| export interface MultiFormatSchemaLikeElement extends ObjectElement { | ||
| hasKey: (value: 'schemaFormat') => true; | 
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.
Question: should we be checking for both schemaFormat and schema presence or is schemaFormat enough? This is for cases where we can have ReferenceElement, SchemaElement or MultiFormatSchemaElement. Currently recognising each element:
- ReferenceElement - recognised when 
$refis present, e.g.: 
$ref: <value>
$ref: <value>
prop: <value>
$ref: <value>
schemaFormat: <value>- MultiFormatSchemaElement - recognised when 
schemaFormatis present, e.g.: 
schemaFormat: <value>
schemaFormat: <value>
schema: <value>
schemaFormat: <value>
prop: <value>- SchemaElement - defaulted to if element was not recognised as 
ReferenceElementorMultiFormatSchemaElement, e.g.: 
prop: <value>
schema: <value>| fixedFields: { | ||
| action: { $ref: '#/visitors/value' }, | ||
| channel: { $ref: '#/visitors/value' }, | ||
| channel: OperationChannelVisitor, | 
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.
Operation.channel is a ReferenceElement but I added a separate visitor for it, so that we can decorate it with metadata (referenced-element: channel). Not sure if we can do it in another way, if we want to have separate visitors for  Operation.channel and OperationReply.channel, and if we want the metadata for them to be different, as currently they both use this visitor.
Add tests and fixes related to them.
TODO:
MultiFormatSchema) => verified and adjusted based on snapshots