
유형마다 필요한 속성이 다르다. 검사는 세 단계로 한다. JSON 문법, 유형별 필수 속성, 본문에 보이는 값과의 일치다.
JSON-LD는 브라우저 화면에 나오지 않는다. 쉼표 하나가 틀려도, 가격이 본문과 달라도 사이트 운영자는 모르고 지나간다. Google 지침은 필수 속성이 빠지면 리치 결과 대상이 아니고 구조화 데이터가 페이지 내용을 사실대로 표현해야 한다고 적었다. 배포 전에 기계로 걸러야 한다.
Google 검색 센터 문서 기준(2026-11-29 확인):
| 유형 | 필수 | 권장 |
|---|---|---|
| Article(BlogPosting, NewsArticle) | 없음 | headline, author(name, url), datePublished, dateModified, image |
| Product(상품 스니펫) | name + review·aggregateRating·offers 중 하나 | offers, aggregateRating, review |
| Organization | 없음 | name, url, logo, address, contactPoint, sameAs 등 |
| BreadcrumbList | itemListElement(ListItem 2개 이상), 각 항목 position·name, 마지막을 뺀 항목의 item(URL) | - |
검사기(tools/jsonld_check.py)의 규칙 표와 본문 일치 검사:
# 유형: (필수, 하나 이상 필수, 권장)
RULES = {
"Article": ([], [], ["headline", "author", "datePublished", "dateModified", "image"]),
"Product": (["name"], ["offers", "review", "aggregateRating"], ["image", "description", "sku", "brand"]),
"Organization": ([], [], ["name", "url", "logo"]),
"BreadcrumbList": (["itemListElement"], [], []),
# ... 생략
}
# 본문에 보여야 하는 값(점 표기 경로)
VISIBLE_KEYS = {
"Product": ["name", "offers.price", "aggregateRating.ratingValue"],
"Article": ["headline"],
}
for path in VISIBLE_KEYS.get(t, []):
for v in _values(item, path):
if isinstance(v, (str, int, float)) and _norm(v) not in _norm(visible):
msgs.append(("오류", f"본문에 보이지 않는 값: {path}={v}"))
_norm은 공백과 쉼표를 지운다. 본문의 "18,000원"과 JSON-LD의 18000을 같은 값으로 보기 위해서다.
일부러 틀린 예제(examples/broken-product.html)를 만들었다. 본문 가격은 16,000원인데 JSON-LD는 15000이다. 본문에 없는 별점 4.9를 넣었고 두 번째 블록 끝에 쉼표가 남아 있다.
== site/index.html
[WebSite] 통과
== site/beans/ethiopia-yirgacheffe.html
[Product] 통과
[BreadcrumbList] 통과
== site/guides/hand-drip-ratio.html
[Article] 통과
== site/faq.html
[FAQPage] 참고: Google FAQ 리치 결과는 2026-05-07부터 표시되지 않는다(schema.org 어휘로는 유효)
== site/about.html
[Organization] 통과
== site/guides/hand-drip-ratio-before.html
[-] 참고: JSON-LD 없음
== examples/broken-product.html
[Product] 참고: 권장 속성 없음: image, description, sku, brand
[Product] 오류: 본문에 보이지 않는 값: offers.price=15000
[Product] 오류: 본문에 보이지 않는 값: aggregateRating.ratingValue=4.9
[블록 2] 오류: JSON 문법 오류: Illegal trailing comma before end of array (줄 7, 열 67)
== examples/broken-breadcrumb.html
[BreadcrumbList] 오류: 1번째 ListItem에 item(URL)이 없다(마지막 항목만 생략 가능)
첫 항목 "홈"에 URL(item)이 없다. 마지막 항목만 URL을 생략할 수 있다.
구현 코드: jsonld_check.py, tests/test_tools.py