Responding to the user request for validation against a schema for API testing

API testing provides faster test results, allows quicker feedback loops, and speeds up the development flow. It’s also less time-consuming compared to UI testing. That’s why more and more projects, especially those of large businesses or enterprises, involve a lot of API testing.

There’s a significant need for schema compliance for API testing

When API tests scale up, there’s a need for continuously validating responses. The same goes for requests. Just a miss in a request body might cause the cost of time, latency, or server resources. Guarding against bad input is always a good practice.

If you search in our Katalon community, there are many questions raised on how to validate responses with an expected or pre-defined schema (like this one). We also receive many tickets raised from our paid-license users, requesting a convenient way or feature to validate an instance document.

If you don’t know what a schema is, it describes the structure, types, and format of data. You can look at the example of a JSON schema in their documentation to understand more about this matter.

So, we respond to our user requests.

There are certainly many difficulties to overcome to develop new functionalities. The first thing is to verify the users’ needs. We have our product or customer success team talk to the requesting users to clarify their needs, for example, what kinds of APIs and formats they need support. We also look into the topics in our community to collect more data from other users to back up and confirm the validation of the request.

From there, our engineering team goes on and lists out all the core functionalities and specifications. Then, we continue to research everything related, including the supporting technology, base knowledge, and current solutions on the market.

R&D is always the first priority. Certain team members will be assigned to researching the technology and base knowledge, then present it back to other members and teams (including developers, QAs, PMs, and technical writers). We want to avoid the situation where a member doesn’t know how to do their work with newly-developed functionalities due to a lack of knowledge.

We’ll then look into the specifications to see how we can build and deliver what are requested in a way that can fit into our existing product. There are many proposed solutions, including those from third parties, that can help us develop Katalon to meet the users’ needs. We organize meetings and discuss internally to decide which would be the most optimal.

Katalon Community cannot be overlooked for insights.

As the community has been established from day one, there are so many insights that are valuable for us. In this case, many topics are raised to ask for the ways to validate responses against a pre-defined schema; and some active and experienced members have found and provided their solutions and insights to those in help. Like this one. These insights are very helpful for us to think of ideas and directions to develop the new functionalities.

They also consult us on the right technical terms and words to use during the PoC phase. Kudos!

With Katalon 8.4.0, users can now validate JSON/ XML/ GraphQL instances against respective schemas.

In particular, users can validate:

  • RESTful request and response body content with JSON schemas
  • RESTful and SOAP request and response body content with XML schemas
  • GraphQL request body content with GraphQL schemas

You can find more information in our documentation for Schema compliance testing in Katalon Studio.

This new feature is ideal for large projects where there are many API sets, cross-team collaborations, Dev-QA communications, and contract testing involved. It allows tests to be executed earlier with higher confidence (as requests are validated before sending to the server and responses follow the pre-defined standard). The development team should prepare the schemas soon so that the testing teams can write tests based on those. Don’t need to wait until the development is complete.

Feedback from our users is needed.

Compared to other functionalities for UI testing, the need to validate requests and responses with the use of schemas is not very common. So, it may take more time for our users to experience and provide feedback so that we can take action and make improvements if needed.

If you’re a new user, you can download Katalon Studio and have a 30-day trial to use this new feature (along with other functionalities) and learn more about API testing.

If you’re using Katalon Studio Enterprise, you can try it out now and provide us feedback.

Special thanks to @duyluong for sharing his thoughts and experience on this topic. Hope it helps you get more insights into our product development.

If you want to read more articles like this one, visit our Product insights corner.

Have a nice day!

2 Likes

Viet:

This is an improvement, however, implementing was is described on the page shared (link below), requires the QA person to dissect the spec into schema snippets. This process requires manual editing manual decomposition of references. This is time consuming, error prone, and not conducive to API design-first.

Other products now have features that parse the API spec to match and validate the responses without having to manually edit. I feel Katalon is still behind on this important API testing aspect.

Thank you.

3 Likes

Hello @rburgos. Thank you for your feedback. It’s really important for our future product improvement.

Hello @duyluong, please have a look at this feedback. Thank you.

1 Like