# Getting error message when comparing 2 exact API requests

**URL:** <https://community.postman.com/t/getting-error-message-when-comparing-2-exact-api-requests/7774>\
**Category:** Help Hub\
**Tags:** request, postman, postman-api, ajv\
**Created:** [September 13, 2019, 9:27am UTC](https://community.postman.com/t/getting-error-message-when-comparing-2-exact-api-requests/7774 "2019-09-13T09:27:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisrine](https://avatars.discourse-cdn.com/v4/letter/n/aeb1de/32.png) [@Nisrine](https://community.postman.com/u/Nisrine)\
**Post date:** [September 13, 2019, 9:27am UTC](https://community.postman.com/t/getting-error-message-when-comparing-2-exact-api-requests/7774/1 "2019-09-13T09:27:32Z")

</div>

i want to compare 2 API requests on postman. Both APIs give same request and the same schema is added in both APIs:

```auto
schema = {
        "properties": {
            "errors": {
                "type": "boolean"
            },
            "data": {
                "type": "object",
                "properties": {
                    "item_favorites":{
                        "type": "array",
                                  "items" : [
                                       {"type": "object",
                                            "properties":{
                                                 "id": {"type":"number"},}}]}}}}}

```

I added in request A :  
`pm.globals.set("Storeschema", pm.response.json());`  
and in request B, i added the following script:

```auto
pm.test("compare responses", () =>
    pm.expect(pm.response.json()).to.equal(pm.globals.get("Storeschema")));

```

i got the following error message 😕

```auto
compare responses | AssertionError: expected { Object (errors, data) } to equal { Object (data, errors) }

```
