Idea 9: asynApiDiff

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

This was my initial thought on solving this, I think it would be better to manage all additions, deletions and changes. That we will be able to reproduce a changelog UI.

This is an updated approach, AsyncApiDiff_v2 · GitHub
we can still make the data structure better, I was just testing for the info component.

Thank you so much for this.

Best would be to put all of this in a google doc and share it as per the guidelines here GSoC 2021 Guidelines

Do reply here with the details once you’ve been able to do so

Cheers

Thank you @Sharath_Iyengar, I have shared my proposal giving gsoc@postman.com editor rights, I had a doubt about the timeline, would be very helpfull if I get some suggestions.