Validate JSON matches expected schema

Is there a way to validate that response received in JSON matches expected/pre-defined schema?

I have seen some old posts (2018 and 2019) about this using some involved custom code. Are there any updates on this area?

No, there isn’t any. Custom coding is still required in the latest version of KS.

@rburgos

We are about to release a PoC to support Schema validation (JSON/XML) next month. Please stay tuned.

1 Like

Do you have a description of the upcoming feature? Basically, I am looking to know if you are planning to validate if JSON is valid, or if JSON matches target schema.

Thank you.

@duyluong – my organization has an enterprise license, it would be of interest to join the POC, if possible. Can I get additional information?

@rburgos

For more details about the new features and download link of the PoC, please refer to our document:

2 Likes

@duyluong Perhaps the tech writing team should review the docs.
see comments from @kazurayam

‘Schema validation’ is misleading for a QA engineer.
It suggest that it means to validate a certain schema (against a draft spec?)

‘JSON/XML validation with schema’ makes more sense …

1 Like

That is exactly what is needed. To validate the end-point’s response matches the target schema.

The article also has an intro. Perhaps additional description of applicable use-cases might help.

BTW, this is a feature that is being offered by several direct/indirect competitors of Katalon specially but those that deal more on the API/services space.

If ‘this is exactly what is needed’ you are confused too.
I used ‘json schema validation’ a lot (in both ways)
The current POC implementation will validate a json string/response against a DRAFT_whatever spec schema (will see what DRAFT spec version it is supported later)
aka as u said: To validate the end-point’s response matches the target schema.

To validate a schema (as the doc title suggest) is a different animal!

Kindly read: https://json-schema.org/specification.html

Today the doc still shows:

Schema Validation for API Testing (PoC)

Would you like to argue more? Or perhaps, as long as you understand somehow the about to be implemented feature, the documentation is no longer relevant?

It doesn’t take much digging to figure out the docs have this completely wrong.

@Jass @duyluong Before this PoC/feature gains too much traction and invites users to completely misinterpret its intent and purpose, please understand the difference (highlighted by @bionel) and fix the documentation.

If one of us (few) were around 5+ years ago to advise you, the mismatch between WebUI.setText and WebUI.getText (dare I mention WebUI.getAttribute?) wouldn’t have happened. Let’s nip this one in the bud while we have a chance PLEASE!

I saw SmartBear SoapUI/ ReadyAPI use a word Schema Compliance Assertion. How about KS use that instead?

1 Like

Hi @rburgos, we definitely can connect you with our business team. Please send your request to business@katalon.com for more commercial purposes.

Should you need any other support, please let me know.