-
-
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
Message ID doesn't exist on reply level #873
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
@AceTheCreator could you please provide a code snippet of what you are executing and the output? Thank you! |
@smoya, here's a sample code snippet AsyncAPI document
Here's the code I'm trying to retrieve the ID with
Here's what I get in the console |
Can this be somehow related to the issue under #856 @jonaslagoni ? |
The
Not related, no 🙂 |
Whether this behavior is the right and expected behavior, we will have to chime in @magicmatatjahu 😄 Or @fmvilas 🤔 |
I don't think it's the expected one. IMHO it should return the id of the message, most likely the one coming from the key under |
The problem then is the way references are currently being handled, is NOT to replace the reference in operations to channels and messages with the already resolved object that we created for the instance in the channel. We don't have access to the key in the key/value pair that is being referenced. Therefore the ONLY possible solution we can do is the current approach, at least with the current tooling we have at hand. Otherwise, we have to create our own reference tooling that can resolve partial references and manually control what instance should be returned. |
Just kind reminder that we knew that using $ref everywhere will have a side effect that it will he harder to get the id of the element and that we will have to hook into dereferencing process. So instead of waiting for or working on completely new tool that handles references, parser should grab id from the reference, and put in some extension like |
It is not a trivial thing. Dereference is not handled by the parser directly but by @stoplight/json-ref-resolver (nothing new, we already knew). The fact we would need to get access to the surroundings of the referenced object in order to get the key of the map if exists makes it even harder. |
@smoya you have the key of referenced object in the reference itself, as part of $ref string |
@smoya I think |
It is just a draft, a proof of concept. It takes the last part of the pointer as the Id. |
sounds good to me |
Should be solved, feel free to re-open if you still encounter it 🙂 |
When using the request-reply pattern, and you're trying to retrieve the reply() messages, the parser is returning the wrong message ID for some reason.
Here's what I mean by wrong messages. In the example below, I expect the parser to return the messageID of the messages available in the reply object, but instead, all I get is the index(
integer
) of the message as IDcc @smoya @fmvilas
The text was updated successfully, but these errors were encountered: