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

Non-JSON response causes field-wise match to always pass #2406

Open
ptrthomas opened this issue Sep 28, 2023 · 9 comments
Open

Non-JSON response causes field-wise match to always pass #2406

ptrthomas opened this issue Sep 28, 2023 · 9 comments
Assignees

Comments

@ptrthomas
Copy link
Member

as reported here: https://stackoverflow.com/q/77190740/143475

This should fail, but works:

* def response = ''
* match response.id == '#null'
* match response.time == '#present'

this fails as expected:

* def response = {}
* match response.id == '#null'
* match response.time == '#present'

but this is what teams are recommended to use:

* def response = ''
* match response == { id: '#null', time: '#present' }

that said, we should make the first example above fail

@pranav7972
Copy link

pranav7972 commented Sep 28, 2023

Hello Sir, Can vou assian this to me?

@ptrthomas
Copy link
Member Author

@pranav7972 you are welcome to work on this, what's important is a PR: https://github.com/karatelabs/karate/blob/master/.github/CONTRIBUTING.md

@MSD-12
Copy link

MSD-12 commented Oct 2, 2023

Hi @ptrthomas can you please assign this issue to me

@ptrthomas
Copy link
Member Author

@MSD-12 I honestly don't know if @pranav7972 is working on this, but you are welcome to work on a PR

@MSD-12
Copy link

MSD-12 commented Oct 7, 2023

Hi @ptrthomas can you please guide me in reproducing this bug

@ptrthomas
Copy link
Member Author

@MSD-12 please see first comment

@Songshen1996
Copy link
Contributor

Hi sir, I think I just found a solution to this issue, can you assign this to me?

@ptrthomas
Copy link
Member Author

@Songshen1996 consider this assigned to you, go ahead, also see: https://github.com/karatelabs/karate/wiki/Hacktoberfest

@Songshen1996
Copy link
Contributor

Songshen1996 commented Oct 28, 2023

@Songshen1996 consider this assigned to you, go ahead, also see: https://github.com/karatelabs/karate/wiki/Hacktoberfest
@ptrthomas
I want to push from my cloned project, but I can't do that because my name didn't appear in the list of authors. I'm having this problem when I trying to fix this issue:

1698480997075

Songshen1996 added a commit to Songshen1996/karate that referenced this issue Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants