-
-
Notifications
You must be signed in to change notification settings - Fork 264
feat: add new custom resolver to fetch the reference from private repo #1875
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
Conversation
🦋 Changeset detectedLatest commit: da60cf0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Changeset has been generated for this PR as part of auto-changeset workflow.Please review the changeset before merging the PR.If you are a maintainer or the author of the PR, you can change the changeset by clicking here Tip If you don't want auto-changeset to run on this PR, you can add the label |
| const result = await validationService.validateDocument(specFile, options); | ||
|
|
||
| // The validation succeeds but the document is invalid due to unresolved ref | ||
| expect(result.success).to.equal(true); |
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.
@fmvilas success is true defines the command is successfully executed
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.
The validation succeeds but the document is invalid
This is tricky, isn't it? How would you justify this decision to another developer whenever they get result.success ==== true but the document is invalid? If that's the case, we can't rely on result.success to see if the document is valid or not.
Also, think about it, "validation succeeds" but it's "invalid" (i.e., not valid). Isn't it a contradiction?
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.
@fmvilas, actually, the success is defined complete execution of the command; it is independent of whether the document is valid or not.
If the document is invalid in, we can see a status field that shows data: { status: invalid}, we can check in the following the pic : )

I have added a comment on the test cases to avoid confusion : )
3a97747 to
8c3b95c
Compare
|
Please next time don't force-push 🙏 It completely removes the whole history and makes it harder to review. |
| const result = await validationService.validateDocument(specFile, options); | ||
|
|
||
| // The validation succeeds but the document is invalid due to unresolved ref | ||
| expect(result.success).to.equal(true); |
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.
The validation succeeds but the document is invalid
This is tricky, isn't it? How would you justify this decision to another developer whenever they get result.success ==== true but the document is invalid? If that's the case, we can't rely on result.success to see if the document is valid or not.
Also, think about it, "validation succeeds" but it's "invalid" (i.e., not valid). Isn't it a contradiction?
|
@asyncapi/bounty_team |
Co-authored-by: Fran Méndez <fmvilas@gmail.com>
So, how all services currently work, is if there is a uncaught or unresolveable error it returns an error response. The This can be changed though if you have some suggestions. You can see it here: |
|
/u |
|
/u |
I see it's not an issue of this PR but it's definitely weird, don't you think so? Think about the devs than don't know the code base and are only using the CLI. |
fmvilas
left a comment
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.
Let's get this merged 🙂
cc @asyncapi/bounty_team
|
/u |
|
|
/rtm |
|
Yeah, if CLI users are not suffering it, that's fine. However, I think it's a fine line. If you're not aware of this difference, it's easy to push wrong code in the future. As per how to fix it, I'd just make it fail. If something doesn't resolve, trigger the error. A call to a method called The above is if you want to preserve the current API. I'd go one step beyond and simply remove the |




Resolves: #1796