Ask a Question

Rest API: validate dinamic attibute name

SOLVED
msalvador
Frequent Contributor

Rest API: validate dinamic attibute name

Hi guys,

I'm approacing to soap ui.

I have call with post my API, I pass in the header a json.

Response is a JSON, and must have or not attribute in the response.

I would like to check assertions, with tose dinamic attributes.

 

in attachment my project.

 

 

8 REPLIES 8
nmrao
Champion Level 3

Are you missing to add something to your question?


Regards,
Rao.
richie
Community Hero

Hey @msalvador,

Just reiterating what Rao said.
You intend to use soapui...do you mean the open source version or the licensed ReadyAPI! tool?

In regards to your description, you say you have a REST API to test....it uses a POST method and the payload of the request is in .json type and the response has a .json payload too.
You want to assert against the content of the response's payload.

This all sounds typical stuff....does all my above description sound correct?

So what exactly is the question you want answering?

Also, you state you attached a file, but there wasnt any attachment in your post...?? Did i misunderstand?

Cheers,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
msalvador
Frequent Contributor

The only "outcome" attribute is required, next update and list attributes are dynamic.

nmrao
Champion Level 3

Please use json path assertion.


Regards,
Rao.
sonya_m
SmartBear Alumni (Retired)

@msalvador , were you able to try what's suggested? Using the json assertion? Please share.


Sonya Mihaljova
Community and Education Specialist

msalvador
Frequent Contributor

no I wasn'

nmrao
Champion Level 3

Please find the documentation for json path.
https://support.smartbear.com/readyapi/docs/testing/jsonpath-reference.html


Regards,
Rao.
sonya_m
SmartBear Alumni (Retired)

Thanks Rao!

 

@msalvador The documentation Rao provided should help you achieve your goal. Please let us know if you need more help on this!


Sonya Mihaljova
Community and Education Specialist

cancel
Showing results for 
Search instead for 
Did you mean: