structured-data-testing-tool icon indicating copy to clipboard operation
structured-data-testing-tool copied to clipboard

How to test nested Object

Open xuanzhaopeng opened this issue 4 years ago • 1 comments

Describe the bug Given we have this structured data:

{
   Product: [
        { name: "p1",  "offers": [ {"@type": "Offer", "name": "p1o1"}, {"@type": "Offer", "name": "p1o2"} ]  },
       { name: "p2",  "offers": [ {"@type": "Offer", "name": "p2o1"}, {"@type": "Offer", "name": "p2o2"} ]  },
   ]
}

Question: How can I define the preset for testing Product[*].offers[*].name are exist for all

For example the schema: https://schema.org/offers

xuanzhaopeng avatar May 25 '20 21:05 xuanzhaopeng

Thanks! I don't have an answer for you right now and it will be probably be a little while before there is one, but use cases like this are helpful.

There is some work on going for more complex models and all examples of things that are not caught yet (but should be) will be added as tests.

iaincollins avatar Jun 11 '20 23:06 iaincollins