简体   繁体   English

杰森和放心

[英]Json and rest-assured

I'm new in rest assured and Java. 我是Java和Java的新手。 I need help , I want to create a Json object ( Array Json with key , value ) that I can add / remove parameters , and change the values . 我需要帮助,我想创建一个Json对象(带有键,值的Array Json),可以添加/删除参数并更改值。 I need the Json to be generic & dynamic - I hope it make sense ... After I want to call a get API and validate using rest assured that all the return keys and values in the response are present in the Json object I have created before . 我需要Json具有通用性和动态性-我希望这是有道理的。。。我想调用get API并使用放心的方法进行验证后,确保响应中的所有返回键和值都在我创建的Json对象中之前。 Can anyone help understand how to start the solution for this ? 谁能帮助您了解如何为此启动解决方案?

Thank you all 谢谢你们

Since you are new to both RA and Java, may I suggest you evaluate Karate because in my opinion, it is far easier to do what you have described, for example look at this example cats.feature . 由于您是RA和Java的新手,因此我建议您对Karate进行评估,因为在我看来,做您描述的事情要容易得多,例如,看这个例子cats.feature

Karate allows you to also read JSON from a file and modify it. 空手道使您还可以从文件中读取JSON并进行修改。 You can also modify responses and re-use them for future requests. 您还可以修改响应并将其重新用于将来的请求。

Disclaimer: am dev. 免责声明:是开发人员。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM