Repository navigation
Closed
Labels
Description
This issue contains list of possible features that we wanna introduce in the v2.0.0 of ParserJS. Have in mind that some of them may not be implemented. You can also write your own proposals/features/PRs in the comments, I will update then the main list.
Note: Mainly PRs should be merged to the
next-majorbranch. Additionally, some of the following issues will only be fixable/implementable once the other issues are resolved.
- Migrate project to TypeScript #482
- Implement Parser-API (Intent-Driven) #401
- Integrate stoplight/spectral in parser #477
- Parser should return all errors #329 - Spectral supports that out of the box
- Parse and validate bindings #315 - we need to wait for that PR feat: add binding validation spec-json-schemas#239. Spectral will supports bindings validation out of the box, but if we need, we can improve error messages for that.
- Add validation of message examples #99
- New interface for custom schema parser #480
- Maybe make
stringifyfunction available on the instance of AsyncAPIDocument class #421 - Add format object type for MessageExample #321
- Throw meaningfull error when parser of specific schemaFormat is not available #157
Nice To Have
- Handle circular refs in extensions and bindings #294
- References are bundled before validated #405
- Dereference behavior does not follow AsyncAPI reference object and JSON Schema draft 7 behavior #404 - we need to check that in v2 by simple tests
- JSON Schema references do not follow $id dereference behavior #403 - we need to check that in v2 by simple tests
- parser doesn't validates the
$reflinks #360 - we need to check that in v2 by simple tests - Getting a validation error while attempting to parse a document points to a url that does not exist #224 - we need to check that in v2 by simple tests
- Integrate the extension catalog with the JS parser #50
- Improve error handling in parser #119 - we need to wait for that mentorship project https://github.com/imabp/asyncapi_problem
Reacted by Sergio Moya, Khuda Dad Nomani, Anubhav Vats, Fran Méndez and Jonas Lagoni
Activity
smoya commentedon Mar 7, 2022
@magicmatatjahu would you mind adding #482 into the list?
magicmatatjahu commentedon Mar 7, 2022
@smoya Added :)
smoya commentedon Jul 11, 2022
@magicmatatjahu as #294 is not really a BC, we can remove it from the list so we move forward just with the minimum.
smoya commentedon Jul 11, 2022
@magicmatatjahu as #405 is not really a BC, we can remove it from the list so we move forward just with the minimum.
smoya commentedon Jul 11, 2022
@magicmatatjahu as #404 is not really a BC, we can remove it from the list so we move forward just with the minimum.
smoya commentedon Jul 11, 2022
@magicmatatjahu I'm concerned about #403 as this would become a BC, so perfect for the new parser version, but it requires a lot of effort. Do you think we should invest on this for the next version of the Parser? cc @jonaslagoni @fmvilas
smoya commentedon Jul 11, 2022
@magicmatatjahu can you annotate #201 is done?
smoya commentedon Jul 11, 2022
@magicmatatjahu as #157 is not really a BC, we can remove it from the list so we move forward just with the minimum.
smoya commentedon Jul 11, 2022
We could build another list, instead of removing issues, with the Nice To Have issues. In case there is time or people willing to take those.
EDIT: Here is the list @magicmatatjahu . You can add it right after the current list on the description of this issue.
Nice To Have
smoya commentedon Jul 11, 2022
@magicmatatjahu This is going to be needed as well asyncapi/parser-api#69
smoya commentedon Jul 26, 2022
After giving another thought to the list of tasks for v2.0.0 of the parser, I think we can go further and reduce the scope. I considered AsyncAPI Roadmap at all moments to see how we could deliver value asap (the new API).
Here is what I would suggest we could move with, but I know @magicmatatjahu had strong reasons not to discard some of the tasks, so I'm going to ask you if you could expand info on why you believe those are needed. I'm addressing to you since you created most of those issues, also because you have a good knowledge of the v1.x code base, however, anyone is invited and encouraged to jump into this discussion so we can find the minimum required features for the new version.
Integrate stoplight/spectral in parser #477-> Ok, it's a really cool feature from the developer point of view, but could we copy the current parser-js logic into the new TS version?New interface for custom schema parser #480-> Is it really needed for this version? If we don't move into spectral atm, I think it's not.Throw meaningfull error when parser of specific schemaFormat is not available #157Integrate the extension catalog with the JS parser #50jonaslagoni commentedon Jul 26, 2022
Tbh, the only thing I see as required would be #482 (because that's already underway) and #401 (because well, that is what triggers this rewrite).
My reason for only those two is that is what is directly needed from the generator's perspective and probably where #401 is needed the most.
That said, remember... You can do another major release in another month if that's what you would like to do where you address even more of these issues. Nobody is stopping you from releasing new major versions of the parser.
magicmatatjahu commentedon Jul 27, 2022
@smoya
I already explained you. For me it would be too much pointless work, because from the beginning there was a thought to use Spectral and for that we have collaborations with Spotlight team regarding the official ruleset AsyncAPI. However if community thinks that it's better idea (it's usually right, isn't?) we can do this, but we should discuss that. cc @derberg @jonaslagoni @fmvilas
If we do not go with Spectral then it is not needed, but the function
validateis made to use it later in the context of Spectral and to return errors when validating the used schema in a custom format, that is, where the problem occurred, etc. Currently, the given solution does not have this, and for me this is a serious problem from the UX level - the user does not know where the error is and sometimes also what problem, because he/she see only runtime error, not meaningful error for human,For this we have in mentorship program that project https://github.com/imabp/asyncapi_problem but with Spectral we won't need that in 99% cases. As I think there, even in the case of using logic from our parser, it should not be necessary. I would throw this issue from the scope and even close it.
8 remaining items
derberg commentedon Jul 28, 2022
I think this is the key in discussion about spectral in or out.
Writing custom validators is time-consuming, requires lots of testing and is vulnerable to changes to spec. I know, I wrote them (of course it may also be a case that they could be written better 😄 but don't tell me that, I have feelings 😆 ). This is also why we still do not have all the validations in place (for example message example validation).
I see @magicmatatjahu already extended AsyncAPI Spectral rule with custom validation. Only uniqueness of messageId is missing.
I'm only concerned about errors. Can you share please how validation error will look like when spectral notices that
operationIdis duplicated? It is not clear to me from your conversation, so I need to see a real example before I can share my comment on that topic.Independently from above, what is the problem really 😆
My position is: When we plan 1.0 of some library, it makes sense to set some list of stuff that we fill are needed to be there for the first production release. But 2.0, 3.0, 4.0 - in only blocks development are release of improvements really 😄 and forces work on feature branches, and doing multiple features at the same time and blocking each other 😄
For example, if you want spectral, and you started a discussion a long time ago in #477, and there were no objections => then just propose how you wanna do it, and do it 😆
Spectral has nothing to do with TypeScript and nothing to do with new parser API. Why can't we jump from parser 1.0 to 4.0 in a year? It is not a harm to the community, but actually a good thing. People do not care about numbers as they have
package-lockto protect them. They care about improvements.magicmatatjahu commentedon Jul 28, 2022
@derberg
There are tests for that, you can check (and also for other rules in other files) outputs: https://github.com/stoplightio/spectral/blob/develop/packages/rulesets/src/asyncapi/__tests__/asyncapi-operation-operationId-uniqueness.test.ts
We can always change description of error.
derberg commentedon Jul 28, 2022
So from what I see, spectral can be introduced separately, probably even as not a breaking change, we just transform their errors to ours, because we use json pointer to point to location where error is. We also do not need severity for now, as we anyway want to integrate errors only first, right?
anyway, for me fundamentally most important is to drop thinking about road to 2.0, 3.0 etc 😄 as parser and other libraries evolve separately from the spec.
fmvilas commentedon Jul 28, 2022
My two cents: go with what @derberg is saying. You don't need to decide what goes into v2.0.0. Just move ahead with whatever you already have. Don't make things depend on each other when they're not dependent, really. Want Spectral? Cool, add it. Want Typescript? Cool, add it too. But that should not block a new API. These are 3 different things. And it's ok to end up with Parser 6.0.0 in, say, November.
magicmatatjahu commentedon Jul 28, 2022
@derberg
I would not share this opinion, because if we want to integrate Spectral we should go with its output from beginning and not convert it to our output (I am talking about the result of validation). The strength of Spectral is that you can create spec governance of the company/organization with it and these severity in this regard are super important.
If we weren't to go with Spectral now, then 2.0.0 we go only with the new API, and in 3.0.0 the improved API after testing with Spectral integration.
derberg commentedon Aug 16, 2022
@magicmatatjahu I added a follow-up comment about spectral in #477 (comment) to not "pollute" this thread with technical details of just one feature.
maybe 🤷🏼 tbh I do not know how complicated it is to integrate Spectral nor how advanced work on the new API is 😄 maybe we get Spectral in sooner 😄 More important is that we agree that we do not need major release planning and roadmaps
magicmatatjahu commentedon Sep 7, 2022
Leftover tasks:
x-parser-schema-id). See anonymousNaming.jsto discuss
parser-apiAPI. (cc @smoya)next-majorsource code.masterbranchRequired tasks in other repos:
Review/Discussion:
Nice to have:
cc @smoya @derberg @fmvilas
smoya commentedon Sep 9, 2022
@magicmatatjahu you can mark
Model updates (fixes) according to parser-api API.as done as it has been mergedsmoya commentedon Sep 13, 2022
@magicmatatjahu can you mark
Traversingas done as it has been merged? Also for the record leave the link to the merged PR: #604. Thanks!smoya commentedon Sep 20, 2022
@magicmatatjahu could u please add #620 to the list of TODO?
smoya commentedon Sep 20, 2022
Also this one @magicmatatjahu asyncapi/parser-api#69
magicmatatjahu commentedon Sep 20, 2022
@smoya Done.
fmvilas commentedon Mar 29, 2023
What's really stopping us from releasing Parser v2? I want to move this forward as soon as possible so we can start receiving feedback.
smoya commentedon Mar 29, 2023
There is missing work that should go in Spec v3.0.0 that still is not supported in the Parser. Champions are willing to work on it. See asyncapi/spec#691 (comment)
Some kind of summary: