-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
refactor: remove mixins and add AsyncAPI TS types #581
refactor: remove mixins and add AsyncAPI TS types #581
Conversation
151c671
to
cc0202d
Compare
78b4d57
to
1764391
Compare
@magicmatatjahu It was hard to me to understand those interfaces represent the actual AsyncAPI Spec by each version. I want to suggest we change the dir |
src/interfaces/v2.ts
Outdated
@@ -0,0 +1,380 @@ | |||
import type { JSONSchema7, JSONSchema7Type } from "json-schema"; | |||
|
|||
export type AsyncAPIVersion = '2.0.0' | '2.1.0' | '2.2.0' | '2.3.0' | '2.4.0'; |
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.
You can play with @asyncapi/specs
package like we do in https://github.com/asyncapi/parser-js/pull/583/files#diff-8fa4b52909f895e8cda060d2035234e0a42ca2c7d3f8f8de1b35a056537bf199R19 instead of hardcoding, so if we release 2.5.0
you don't need to update this line.
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.
Package @asyncapi/specs
hasn't exported packages so we cannot "retrieve" types like here https://github.com/asyncapi/parser-js/pull/583/files#diff-8fa4b52909f895e8cda060d2035234e0a42ca2c7d3f8f8de1b35a056537bf199R19
TS is a something like linter, it doesn't read types from runtime.
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.
We can also change that type to string.
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.
Yeah, I would vote for leaving it as string until we refactor @asyncapi/specs
to export the types from it (if we do at some point).
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.
@smoya Done :)
Sure, |
1fa5450
to
7f609e4
Compare
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM! 🚀 🌔
/rtm |
Description
I know that there're a lot of changes, but only due to fact that I had to ride off mixins and add to every model created typings.
cc @smoya
Related issue(s)
Part of #93
Part of #482