Hello Team, Need help with Pact matching for respo...
# general
j
Hello Team, Need help with Pact matching for response body. I have a big response body json of 2000 lines where we have array of templates object. I just want to match 1 object out of 100 templates. I am getting error with failure in matching when I tried this
Copy code
asset_classifier_pact.given(
        "mpid and brand catalog id to retrieve templates"
    ).upon_receiving("return all templates for mpid").with_request(
        method="GET",
        path=api_path,
        query=req_query_param,
        headers=req_headers,
    ).will_respond_with(
        status=200,
        body={
            "templates_are_approved_for_auto_select": None,
            "templates": EachLike(
                {
                    "id": 1,
                    "asset_id": "<any-uuid>",
                    "factory_source_id": 1,
                    "factory_id": "1",
                    "is_manual_selection": False,
                    "status_id": 3,
                    "associations": [
                        {
                            "association_id": 1,
                            "association_source": 1,
                            "imagery_template_id": 1,
                            "id": 1,
                        }
                    ],
                    "manufacturer_part_id": 1,
                    "class_id": 1,
                    "bounding_box": {
                        "minimum_width": 34.0,
                        "minimum_height": 35.0,
                        "minimum_depth": 1.0,
                        "maximum_width": 40.0,
                        "maximum_height": 40.0,
                        "maximum_depth": 3.0,
                    },
                    "gs_type_name": "WallMirrorLargeRound",
                    "optimized_for_automation": "No",
                }
            ),
        },
    )
templates is an array of templates
I want to just match 1 template
Bumping this
y
Hey buddy. I would create a minimal reproducible example on GitHub so itโ€™s easy for a volunteer to pick up the codebase and see if they can provide an answer by experimentation, as a source of being able to help assist them, to assist you ๐Ÿค˜๐Ÿฝ
j
ok got it thanks will tty to do
๐Ÿ™Œ 1