# Validate JSON matches expected schema

**URL:** <https://forum.katalon.com/t/validate-json-matches-expected-schema/63593>\
**Category:** API Testing\
**Tags:** start-page, api-testing, katalon-studio\
**Created:** [March 23, 2022, 1:30am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593 "2022-03-23T01:30:22Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rburgos](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rburgos/32/16104_2.png) [@rburgos](https://forum.katalon.com/u/rburgos)\
**Post date:** [March 23, 2022, 1:30am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/1 "2022-03-23T01:30:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kazurayam](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/kazurayam/32/333_2.png) [@kazurayam](https://forum.katalon.com/u/kazurayam)\
**Post date:** [March 23, 2022, 1:47am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/2 "2022-03-23T01:47:17Z")

</div>

> [@rburgos](#):
>
> Are there any updates on this area?

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

---

<div class="post-metadata">

**Author:** ![duyluong](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/duyluong/32/1116_2.png) [@duyluong](https://forum.katalon.com/u/duyluong)\
**Post date:** [March 23, 2022, 8:19am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/3 "2022-03-23T08:19:20Z")

</div>

@rburgos

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

---

<div class="post-metadata">

**Author:** ![rburgos](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rburgos/32/16104_2.png) [@rburgos](https://forum.katalon.com/u/rburgos)\
**Post date:** [March 23, 2022, 11:49am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/4 "2022-03-23T11:49:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rburgos](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rburgos/32/16104_2.png) [@rburgos](https://forum.katalon.com/u/rburgos)\
**Post date:** [March 23, 2022, 2:34pm UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/5 "2022-03-23T14:34:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![duyluong](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/duyluong/32/1116_2.png) [@duyluong](https://forum.katalon.com/u/duyluong)\
**Post date:** [April 4, 2022, 7:20am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/6 "2022-04-04T07:20:33Z")

</div>

@rburgos

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

> **[Schema Validation for API Testing (PoC)](https://docs.katalon.com/katalon-studio/docs/schema-validation.html)**
>
> This document shows you how to validate a schema for API testing in Katalon Studio.

---

<div class="post-metadata">

**Author:** ![anon46315158](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@anon46315158](https://forum.katalon.com/u/anon46315158)\
**Post date:** [April 4, 2022, 8:42am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/7 "2022-04-04T08:42:00Z")

</div>

@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 …

---

<div class="post-metadata">

**Author:** ![rburgos](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/rburgos/32/16104_2.png) [@rburgos](https://forum.katalon.com/u/rburgos)\
**Post date:** [April 7, 2022, 3:00pm UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/8 "2022-04-07T15:00:43Z")

</div>

> [@anon46315158](#):
>
> It suggest that it means to validate a certain schema (against a draft spec?)

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.

---

<div class="post-metadata">

**Author:** ![anon46315158](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@anon46315158](https://forum.katalon.com/u/anon46315158)\
**Post date:** [April 8, 2022, 12:58pm UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/9 "2022-04-08T12:58:48Z")

</div>

> [@rburgos](#):
>
> That is exactly what is needed. To validate the end-point’s response matches the target schema.

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: [JSON Schema - Specification](https://json-schema.org/specification.html)

Today the doc still shows:

`Schema Validation for API Testing (PoC)`

[https://docs.katalon.com/katalon-studio/docs/schema-validation.html](https://docs.katalon.com/katalon-studio/docs/schema-validation.html)

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?

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [April 8, 2022, 8:50pm UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/10 "2022-04-08T20:50:55Z")

</div>

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 @anon46315158) 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!

---

<div class="post-metadata">

**Author:** ![hiru](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/hiru/32/19930_2.png) [@hiru](https://forum.katalon.com/u/hiru)\
**Post date:** [April 12, 2022, 9:59am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/11 "2022-04-12T09:59:54Z")

</div>

I saw **SmartBear SoapUI/ ReadyAPI** use a word [Schema Compliance Assertion](https://support.smartbear.com/readyapi/docs/testing/assertions/reference/compliance/schema-compliance.html). How about KS use that instead?

---

<div class="post-metadata">

**Author:** ![Jass](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/jass/32/9588_2.png) [@Jass](https://forum.katalon.com/u/Jass)\
**Post date:** [April 12, 2022, 11:09am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/12 "2022-04-12T11:09:29Z")

</div>

Assigned @nam.nguyen on April 12, 2022, 11:09am UTC



---

<div class="post-metadata">

**Author:** ![vu.tran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/vu.tran/32/20584_2.png) [@vu.tran](https://forum.katalon.com/u/vu.tran)\
**Post date:** [April 20, 2022, 9:41am UTC](https://forum.katalon.com/t/validate-json-matches-expected-schema/63593/13 "2022-04-20T09:41:26Z")

</div>

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

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