iaincollins / structured-data-testing-tool

A library and command line tool to help inspect and test for Structured Data.
https://www.npmjs.com/package/structured-data-testing-tool
ISC License
63 stars 14 forks source link

Article Schema not detected & errors not reported #22

Open noodles opened 4 years ago

noodles commented 4 years ago

Describe the bug

When validating Google structured data SDTT is:

  Schema.org > Article - 0% (0 passed, 1 failed)
    ✕  schema found [Article[*]]
        └─  NOT_FOUND

✓ 2 tests passed with 0 warnings.

For this article, the Google tool shows 2 errors:

To Reproduce

2 tests passed with 0 warnings:

sdtt -u "https://amp.sbs.com.au/v1/article/as-qantas-and-international-airlines-prepare-to-ramp-up-flights-how-safe-is-flying/36b7ce75-ece7-42cb-95a1-7f63a9848955?amp=1" -p Google

Schema.org > Article - 0% (0 passed, 1 failed):

sdtt -u "https://amp.sbs.com.au/v1/article/as-qantas-and-international-airlines-prepare-to-ramp-up-flights-how-safe-is-flying/36b7ce75-ece7-42cb-95a1-7f63a9848955?amp=1" --schemas Article -i

Expected behavior

✕ 2 of 4 tests failed with 0 warnings.

SDTT should report the following 2 errors:

  Schema.org > Article - 100% (1 passed, 0 failed)
    ✓  schema in microdata

The Organization & Article schemas should also be recognised in addition to VideoObject & CreativeWork

Screenshots

Google output:

Screen Shot 2020-05-20 at 7 31 00 PM

SDTT output:

Screen Shot 2020-05-20 at 7 31 13 PM

Additional context

SDTT does report that some optional values are empty:

  2 optional structured data properties found had an empty value.
    ├─ Metatags > "uploadDate" 
    └─ VideoObject > VideoObject[0]."uploadDate" 

Were these values optional in v7.0 but are now required in v8.0?

iaincollins commented 4 years ago

Thanks, this is a great write up and very helpful.

I don't have a great 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.

I suspect in this case it's related to nested properties not being comprehensively tested.

In some cases using sdtt to inspect properties is helpful but is not able to validate all nested objects. This is slightly complicated as there are different ways of doing this (some more common than others) but is regarded as a valid defect to report.

prakash-nc commented 3 years ago

I'm also getting the same error so how can we test it ?