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

Provide a way to testing YAML body response #2424

Open
php-coder opened this issue Feb 13, 2024 · 6 comments
Open

Provide a way to testing YAML body response #2424

php-coder opened this issue Feb 13, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@php-coder
Copy link

Problem to solve

I didn't find a way for testing response body in YAML format (for instance, OpenAPI schema). It would be great to have this format supported as well.

Proposal

I see at least 2 ways of implementing it:

  1. add another type of assertion, for example, yamlpath:
[Asserts]
yamlpath "$.validated" == true
  1. provide a filter to convert YAML to JSON to be able to use jsonpath against it:
[Asserts]
body toJSON jsonpath "$.validated" == true
@php-coder php-coder added the enhancement New feature or request label Feb 13, 2024
@fabricereix
Copy link
Collaborator

fabricereix commented Feb 13, 2024

Hi @php-coder,
I like your solution 1.
We could indeed make YAML a first class object like JSON and XML.
However, I don't think we can prioritize that right now.

@beaterblank
Copy link

Hello, I can take this issue, I found an opensource library for yamlpath https://github.com/ejrh/yaml-path/ , I could implement it how jsonpath path is implemented with same functions, Should I go ahead for a PR or do you guys have any other plans with this?

@fabricereix
Copy link
Collaborator

Hi @beaterblank,
Thanks for your interest in Hurl.
We are tring to minimize dependencies as much as possible,
and we prefer to have yamlpath very similar to jsonpath.
Therefore, we prefer not use a dependency for that.

@beaterblank
Copy link

Okay, so I'll need to implement a custom package for yamlpath instead of using an external dependency? Sounds interesting I can try that.

@jcamiel
Copy link
Collaborator

jcamiel commented Feb 15, 2024

Hi @beaterblank

While important this issue is not in our top priority for the moment! If you spend time and efforts and it, there is low chance that we integrate it as it.
That said, we've some low hanging fruits that you can help us if you want to contribute to Hurl => see issues with "Good first issue" label
Thanks !

@beaterblank
Copy link

Hey, Thanks for letting me know, I'll have a look at other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants