Hi, I am Souvik, an undergrad pursuing BE-CSE from Chandigarh University currently in my third year. I would love to contribute to this idea. I read the idea doc and the parser-js.
I was trying to create some of the functionality using what I understood, please give me feedback if I am going in the right direction.
what I was trying to do.
I am taking inspiration from the git changelog, where there are mainly two operations aditions or deletions. Any changes that is being made to the file could be categorized in such a way.
example:
asyncapi: '2.0.0'
info:
title: Example
version: '0.1.0'
channels:
example-channel:
subscribe:
message:
payload:
type: object
properties:
exampleField:
type: string
exampleNumber:
type: number
exampleDate:
type: string
format: date-time
Now if we make any changes to the version, we can visuialize it as a
asyncapi: '2.0.0'
info:
title: Example
-- version: '0.1.0'
++ version: '0.2.0'
channels:
example-channel:
subscribe:
message:
payload:
type: object
properties:
exampleField:
type: string
exampleNumber:
type: number
exampleDate:
type: string
format: date-time
So with this concept I was trying to make a functions that loops through the complete tree and create only register the changes that were done in the individual components
Example code: asyncApiDiff · GitHub
I was testing with this code, this is far from ideal