👉 Want to learn more about Postman? Check my Postman online course. www.udemy.com/course/postman-the-complete-guide/?referralCode=4E8B90BA4B5EE8DA9237
@stefanrhys18384 жыл бұрын
Hello Valentine, I do love watch your videos as it had helped a lot. And this video was much needed. But I have a issue, I noticed your only changing the body that is the response. What if and this does happen alot more then I would want. But if the type is changed. For example we know the type is object but let's say you have a property that is a type string that may change to a type number. The type has changed but not the body. How does ajv get around this. This maybe good for more advance topics of not changing the body of the response.
@vdespa4 жыл бұрын
@@stefanrhys1838 See the next tutorial. It deals with more advanced use-cases.
@hiteshsivabhavirisetty19663 жыл бұрын
After providing required, change the attribute name in the properties and send the request. postman will fail in that case. Example : in you schema, you have mentioned code in both "properties" and in "required". now, change the name "code" to "id(some other name)" postman cannot validate that. the test will be a pass
@daniellister47012 жыл бұрын
I'm about to start creating my first RESTful API, and I have to say that this video alone is going to allow me to focus more on writing the code than the documentation etc. Thank you, keep up the good work Valentin.
@vdespa2 жыл бұрын
Glad it was helpful!
@Przemek_K_2 жыл бұрын
I'm starting to use Postman at work and your tips are incredibly valuable. Thank You very much!
@vdespa2 жыл бұрын
Great to hear! You are welcome. Thank you for leaving a comment.
@lucabamo3 жыл бұрын
The tutorial was very useful for me. I have not understood how schema validation works until I watch this video. Thank you, Valentin!
@vdespa3 жыл бұрын
You are welcome!
@sipinthatbub3 жыл бұрын
Thanks a lot! I moved from not even knowing what a schema is to being able to build a basic one and test it.
@vdespa3 жыл бұрын
Glad I could help!
@teleport965 жыл бұрын
You are just the greatest teacher! How do you find so simple words to explain complex things, I just don't get it... But thank you very much for your hard work! Bought your excellent Postman course on Udemy and several friends did the same after my advice. Again, thank you! Waiting for the new videos about JSON-Schema from you.
@vdespa5 жыл бұрын
Thanks you so much for this amazing comment and your support. I really appreciate it.
@mireyca284 жыл бұрын
This basic json schema validation help me a lot! Thank you very much Valentin!
@vdespa4 жыл бұрын
Thanks for letting me know 👍
@rajatt952 жыл бұрын
Thanks for creating these tutorials. Honestly, I've learned a lot from your UDEMY course and these tutorials.
@vdespa2 жыл бұрын
You're very welcome! Thanks for watching my content and for taking the course.
@djmilen4o4 жыл бұрын
Great video! Nice and clear! Straight to the point!
@vdespa4 жыл бұрын
I am glad it helped! Thanks.
@rajiv08854 жыл бұрын
Thank you Valentin.. ! It was very helpful at right time of testing.
@vdespa4 жыл бұрын
Great to hear that. Thanks!
@Kariemessi10 ай бұрын
Hey Valentin, thanks for this video! I just finished your Udemy course but I struggle a bit to follow up with this one here, are there any video/documentation that I should be aware maybe before watching the Schema? Thanks a lot!
@gustavosouza32924 жыл бұрын
Extremely helpfull this video, I've looking for something to improve my tests in API beyond the status code, body and header....thanks a lot!
@vdespa4 жыл бұрын
Glad it was helpful! Thanks for watching.
@sumitghewade20023 жыл бұрын
Hi Valentin Despa, Thank you for sharing such valuable educational videos. Could you please share the link where did you learn this from. Is there a need to create a mock server for the testing purposes?
@vdespa2 жыл бұрын
Creating a mock server is useful. See json-schema.org/
@mylenna9225 жыл бұрын
Your videos are so useful! Thank you :)
@vdespa5 жыл бұрын
Thank you for watching and for your comment. I appreciate it.
@danny_dainton5 жыл бұрын
Awesome explanation!! 🏆
@vdespa5 жыл бұрын
Thank you, Danny!
@on3p33015 жыл бұрын
@@vdespa Thank you, Valentin! Really useful! :) Please make another video about other assertion cases ^_^
@vdespa5 жыл бұрын
@@on3p3301 Thank you. Which assertions cases are you referring to?
@on3p33015 жыл бұрын
@@vdespa I mean - are there any best practices in assertions with Schema Validation approach ? I mean cases with too much nesting in response. Also, how many types we can validate with S. validation approach - I mean - how to check "date", "array", "img" etc. ?
@vdespa5 жыл бұрын
@@on3p3301 Great question. I will add some additional tutorials explaining how to do that, especially with nested objects, arrays and other types (date). If you have a concrete example response, send me an email at valentin@vdespa.com
@janithdesilva7518 Жыл бұрын
Hi there, How we can validate a json schema which is dynamically changing?
@nenadtrajanovski28243 жыл бұрын
Hi Valentin. I still dont understand the point of why the test should NOT pass on the initial schema when we send {} - empty object??? its on 3:30 on the video. If i send an empty object to the simple schema that you wrote it will pass as well....
@vdespa3 жыл бұрын
It depends if you expect it to pass or not. I guess the concept of required properties is something you need to be aware of.
@nenadtrajanovski28243 жыл бұрын
@@vdespa But there is NOT any required property in the frist schema in your video, thats why I am confused between 3:27 and 3:40 you are saying: "The empty object is coming back but the schema is valid. So what is going on here? This person thought that this particular test and this particular schema will work just fine..." sorry for the big quotation.. So.. we don't have any required properties... why do we expect this test to fail when sending an empty object to this particular schema ?
@vdespa3 жыл бұрын
@@nenadtrajanovski2824 some people don't think they need to add required properties and expect that this example will fail, if needed. Sorry for not being more explicit.
@nenadtrajanovski28243 жыл бұрын
@@vdespa that explains, btw nice job on the udemy course, its a really good starting point in the API testing world, keep up the good work man!!!
@vdespa3 жыл бұрын
@@nenadtrajanovski2824 Thanks, much appreciated!
@jayjaayjaaay944 жыл бұрын
what if "type": "string" but sometimes it can be null (nullable)
@vdespa4 жыл бұрын
string and null are essentially two data types. Use can use "type": ["string", "null"]
@jayjaayjaaay944 жыл бұрын
@@vdespa i seee thank you!
@maorlv52 Жыл бұрын
Thank you! that was very helpful ! :-)
@vdespa Жыл бұрын
Glad it was helpful! You are welcome. Thank you for leaving a comment.
@AndreaBoboOboe5 жыл бұрын
Hi Valentin. Thank You very much for sharing all of this tips! I have a question : it's possible to retrive the schemas from external sources (for example from files or somewhere in the cloud) without write maybe long variables in the Postman code? Thank you!
@vdespa5 жыл бұрын
Thank you for your comment, Andrea. Yes, this is possible. Here is a very simple example: pm.sendRequest("your.schema", function (err, response) { pm.test("Validate schema", () => { pm.response.to.have.jsonSchema(response.json()); }); });
@ivandurak3874 жыл бұрын
@@vdespa Hi Valentin! Thanks for the lesson! I wonder if an external file can be entirely used for my body on sending a POST request for example? Thank you in advance!
@saimatabassum36603 жыл бұрын
@@vdespa what wlll be the url of schema , can you give some live example
@vdespa3 жыл бұрын
@@saimatabassum3660 the URL will be the URL where the schema can be found. You need an external server to host this.
@VivienceHoang5 жыл бұрын
Thanks for sharing this tip!
@vdespa4 жыл бұрын
You are welcome, thank you for your comment!
@satinderpal93932 жыл бұрын
Hi, schema of my response body is dynamic i.e... Sometimes response body is {"address": xyz street, "zip code": 12345, "city": ABCD}. Sometimes it's {"address": xyz street, "zip code": 12345}. How can i code"required" in the Tests in such a scenario. Thanks
@vdespa2 жыл бұрын
So you want to make city optional, right?
@satinderpal93932 жыл бұрын
@@vdespa yes, "city" is not always present in response body
@vdespa2 жыл бұрын
@@satinderpal9393 Have you tried not making it required?
@mustafwm4 жыл бұрын
starts at 3:30
@vdespa4 жыл бұрын
Thank you for pointing this out. I think it is good to know also what not to do.
@jadedrakerider518 Жыл бұрын
What is the rationale of assuming every property is option unless specified otherwise? That seems designed to give false negatives.
@s1h2r3452 жыл бұрын
How to validate request/response schema validation based on Swagger/Open API
@vdespa2 жыл бұрын
AFAIK, there is not automated way to do this. You can use the API feature in Postman and link an API to a collection. You can the manually check if the collection follows the API spec.
@vijaykumar-ut1ze4 жыл бұрын
How to check the schema of request body and also if that request body comes from a external data file?
@vdespa4 жыл бұрын
Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.
@gsVerka4 жыл бұрын
@valentin Despa. I am finding your videos USEFUL. Thank you for sharing your knowledge with the world. One question: { "Value": ""} ---let's say this is the response body. What can I write in "properties": { "Value": {"type": ......What should be the type here?.....}}. I am expecting blank value. Thank you.
@vdespa4 жыл бұрын
Thanks for your comment. This blank value is a string with a length 0.
Question 2: {"Value": "Yes"} ---let's say this is the response body. I can write in "properties": {"Value": {"type":"string"} }. What if I want to check that the string is equal to "Yes" doing schema-validation-way. Thank you. I guess the ANSWER would be the use of enum as shown below: "properties":{"Value": {"enum": "Yes"}
@vdespa4 жыл бұрын
It is hard to know what the problem is in this case. Join the Facebook community (see link in the description) and ask your question there. Consider adding more details, including screenshots. Thanks for understanding.