JSON-LD 中缺少“}”或对象成员名称

问题描述 投票:0回答:2

我已经尝试过这里提到的解决方案

我已经无数次检查过尾随逗号、空格、不均匀的大括号。但他们都没有工作。有人可以帮助我的架构有什么问题吗?

使用 validator.schema 网站检查此链接here

{
    "@context": "https://schema.org",
    "@type": "RealEstateListing",
    "name": "8 Bedroom Residential",
    "description": "Romantic and impressive Mediterranean estate situated on a one acre, street to street view lot in the hills of coveted North Tustin, Villa Fiorile is a custom gated estate in an unmatched setting with mature trees and lush gardens. Grand, intimate, and rich in character and style, this residence is accented by saturated colors, arched windows and doors, interior arched casings, and exposed wood-beamed ceilings. Upon entering the residence, one is welcomed by a dramatic entry hall that leads into the majestic living room anchored by a fireplace with European mahogany windows offering expansive views from Catalina to Palos Verdes and beyond.  French doors in the adjacent sun room lead out to serene grounds with a sparkling all-tile swimming pool. The spacious property offers a main house with five bedrooms, three of which are large enough to be primary suites, each adorned with luxurious spa-like Carrara marble baths. The two additional bedrooms have their own baths. Rich mahogany patio doors and windows surround the home and encourage indoor and outdoor living. Materials used throughout are rarely seen in today’s homes. From the expansive formal living and dining rooms, cozy family room with fireplace and sitting room, and charming kitchen, the authentic Mediterranean finishes showcase the home’s timeless style. The grounds feature an expansive lawn, patios with old world fountains, garden, majestic oak and palm trees, a two-story guest house and separate casita. Homes of this",
    "address": {
      "@type": "PostalAddress",
      "streetAddress": "1621 FOOTHILL BLVD",
      "addressLocality": "SANTA ANA",
      "addressRegion": "CA",
      "postalCode": "92705",
      "addressCountry": "US"
    },
    "geo": {
      "@type": "GeoCoordinates",
      "latitude": 33.760629,
      "longitude": -117.785239
    },
    "image": "https://api1.realtytrac.com/api/v1/properties/photo?u=AZbWrYHm2bcgjXps4ixc7OKvon-poleUd_Rd7GqF0TYPpYtz3JiXjv6_K0Q-Heoc5MAqCPP_s-MxdpH0EIUTFcLOyjCt60liESSDdXwvI7wlsOHWdCkN2XO2BEW8x0mfG5SskhXp9OiFDyghsxT5XM3S-n8o",
    "offers": {
      "@type": "Offer",
      "priceCurrency": "USD",
      "price": "$4999000",
      "URL": "https://www.realtytrac.com/p/foothill-blvd-santa-ana-ca-92705-52061555/",
      "availability": "http://schema.org/InStock"
    },
    "url": "https://www.realtytrac.com/p/foothill-blvd-santa-ana-ca-92705-52061555/"
  }

尝试使用 validator.schema.org 网站对其进行验证,并显示缺少“}”或对象成员名称。

javascript schema json-ld json-schema-validator
2个回答
0
投票

我检查了您网站的源 HTML。它显示有一个

<script type="application/ld+json">
标签,紧跟在
<meta name="robots" content="noindex/nofollow"/>
之后,具有双重编码的LD + JSON内容。内容是这样的:

 &quot;@context&quot;: &quot;https://schema.org&quot;,
    &quot;@type&quot;: &quot;RealEstateListing&quot;,

请检查screenshot of your website.


0
投票

所以我设法解决了这个问题。对于那些将来可能会遇到同样事情的人。这就是我所做的。对于某些上下文,我正在使用 nextJS 并且该脚本被放置在一个特定的页面上,该页面将在稍后注入导致重复。为了解决双脚本问题,我不得不改用内置的 next/script 并将其移到 next/Head 组件之外(请参见下面的屏幕截图)。现在,模式验证器这次只检测到一个具有有效 JSON 值的 ld+json 脚本。

© www.soinside.com 2019 - 2024. All rights reserved.