Skip to content
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

APIMF-3678: Fix loosing referenced request annotations #1326

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

hghianni
Copy link
Contributor

@hghianni hghianni commented Mar 3, 2022

No description provided.

@@ -31,7 +31,8 @@ case class Oas30RequestParser(map: YMap, parentId: String, definitionEntry: YMap
case Left(fullRef) =>
parseRef(fullRef)
case Right(_) =>
val request = adopt(Request(Annotations.virtual()))
val annotations = Annotations.virtual() += BaseVirtualNode(definitionEntry)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is almost a contradiction. If we are adding the ast, then what sense has mark the node as virtual?
Why we need the ast for an object which is not represented by that ast? Maybe we are propagating a bug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@llibarona please comment on this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The node must be virtual because it contains fields which may or may not be contained in the AST inside this node.
That said, we need the lexical of the base node because it can be referenced in other places and if it is just a virtual there is no way of traking the target reference.
The underlying problem is that a virtual field (request) is used to map a typed entry (requestBody) in oas 3

@nschejtman nschejtman merged commit de2c122 into develop Mar 7, 2022
@nschejtman nschejtman deleted the APIMF-3678-2 branch March 7, 2022 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants