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

Yaml Anchors not working #3

Closed
ckeiner opened this issue Feb 8, 2019 · 1 comment
Closed

Yaml Anchors not working #3

ckeiner opened this issue Feb 8, 2019 · 1 comment
Labels

Comments

@ckeiner
Copy link

ckeiner commented Feb 8, 2019

Yaml offers anchors, which can later be references as follows:

- Action : &id1
   Name : Reference Action
   Request :
       Url : https://localhost:8443/
       Method : GET
   Response :
       Httpcode : 200

- Action: *id1

As such, the second action should execute the same requests and validations as the first one but with different objects.
The first action parses correctly and without &id1.
However, the following exception is thrown when the second action is parsed:

com.fasterxml.jackson.core.JsonParseException: Action must either be emtpy or an ObjectNode, and not a TextNode

Using a debugger, it can be seen that the action is indeed parsed as TextNode containing the string id1.
According to issue 85 and issue 6 of the Jackson Dataformats repository, complex reference types will never be supported.

Possible solutions are to either parse with snakeyaml directly or to preprocess the file so these anchors and references are automatically resolved.

@ckeiner ckeiner added the bug label Feb 8, 2019
ckeiner pushed a commit that referenced this issue Feb 18, 2019
Added a small test which shows that the anchors are.
@ckeiner
Copy link
Author

ckeiner commented Feb 18, 2019

Should be fixed with the referenced commit.

@ckeiner ckeiner closed this as completed Feb 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant