parser-js icon indicating copy to clipboard operation
parser-js copied to clipboard

feat: add support for asyncapi 3.0.0 operations and channels

Open fmvilas opened this issue 3 years ago • 4 comments

This PR contains the following changes:

  • Move all the collections from v2 directory to the models directory because their implementation is always the same. Therefore we can reuse them for v3 and beyond. Check out 0791adca4f6187946b990eec764b6f56d4e055af for more details.
  • Adds v3 models to work with v3 operations and channels.
  • Adds npm run dev so it recompiles on file change.

I split all the changes into meaningful commits to make the review more manageable.

fmvilas avatar Oct 13 '22 15:10 fmvilas

BTW, this PR is not yet done. It's still missing some implementations (challenge you to find it 😄) and, of course, tests. I hate writing tests so if someone in their divine presence wants to help this old weary man, please do it by writing some tests.

fmvilas avatar Oct 13 '22 16:10 fmvilas

I hate writing tests so if someone in their divine presence wants to help this old weary man

If you really hate writing tests, I can only suggest you try writing them first before the implementation. That way they don't become a chore but a positive experience 😄 At least in theory 😛

jonaslagoni avatar Oct 13 '22 16:10 jonaslagoni

I hate writing tests so if someone in their divine presence wants to help this old weary man

If you really hate writing tests, I can only suggest you try writing them first before the implementation. That way they don't become a chore but a positive experience 😄 At least in theory 😛

Dude, I've been around for a while. Don't preach the TDD shit at me, please ✋ 😝

fmvilas avatar Oct 14 '22 10:10 fmvilas

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 20 Code Smells

No Coverage information No Coverage information
2.5% 2.5% Duplication

sonarqubecloud[bot] avatar Oct 21 '22 10:10 sonarqubecloud[bot]

@magicmatatjahu what do you mean that the package is broken now? Will it fail if I try to simply import it? Or you mean that not everything is implemented?

fmvilas avatar Oct 26 '22 15:10 fmvilas

@fmvilas I wrote:

  • we don't validate new version of spec
  • we don't have all implemented models

so the package is not broken in this sense that you cannot use it, but due to the fact that we don't validate and parse custom schemas and don't apply traits then the returned model is useless and for now there is no point in using it at all, so I would prefer that the release 3.0.0-next-major-specX of parser be done when we will at least have 90% of the models implemented and validation (at least) based on JSON Schema.

magicmatatjahu avatar Oct 26 '22 15:10 magicmatatjahu

Oh ok, I don't think that's a problem. Yeah, implementation is incomplete but that's expected in this branch.

fmvilas avatar Oct 26 '22 15:10 fmvilas

For me it is also not a big problem to release, but why would anyone need a non-working model? Also simple validation is needed, because the parser-api itself is written in such a way that we have sure that the spec is valid.

magicmatatjahu avatar Oct 26 '22 15:10 magicmatatjahu

@fmvilas So what? Can we merge it?

abongoblob

magicmatatjahu avatar Oct 26 '22 17:10 magicmatatjahu

For me it is also not a big problem to release, but why would anyone need a non-working model? Also simple validation is needed, because the parser-api itself is written in such a way that we have sure that the spec is valid.

Nobody, except us, is using this version of the parser. It's not just that Parser is incomplete but v3 is also incomplete. It's ok, we're not gonna release it anytime soon 😄

So yeah, I approve it but I created this PR so I'm not sure I should be approving it 😅

fmvilas avatar Oct 26 '22 17:10 fmvilas

@fmvilas I forgot about it 🤣 Sorry!

magicmatatjahu avatar Oct 26 '22 17:10 magicmatatjahu

@jonaslagoni Thanks!

magicmatatjahu avatar Oct 26 '22 18:10 magicmatatjahu

/rtm

magicmatatjahu avatar Oct 26 '22 18:10 magicmatatjahu

:tada: This PR is included in version 2.1.0-next-major-spec.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Jul 14 '23 10:07 asyncapi-bot

:tada: This PR is included in version 2.2.0-next-major-spec.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

asyncapi-bot avatar Aug 17 '23 08:08 asyncapi-bot