2016-02-22 49 views
0

Google Email Markup無法驗證JSON-LD,我schema.org中花費的FlightReservation谷歌電子郵件標記測試無法驗證JSON-LD的FlightReservation

標記工具說,「boardingPolicy」類型是錯誤的,「airline」字段丟失,很容易測試自己:只需複製下面的代碼並粘貼它即可。there

有誰知道我能解決這個問題?

<script type="application/ld+json"> 
{ 
    "@context": "http://schema.org", 
    "@type": "FlightReservation", 
    "reservationId": "RXJ34P", 
    "reservationStatus": "ReservationConfirmed", 
    "passengerPriorityStatus": "Fast Track", 
    "passengerSequenceNumber": "ABC123", 
    "securityScreening": "TSA PreCheck", 
    "underName": { 
    "@type": "Person", 
    "name": "Eva Green" 
    }, 
    "reservationFor": { 
    "@type": "Flight", 
    "flightNumber": "UA110", 
    "provider": { 
     "@type": "Airline", 
     "name": "Continental", 
     "iataCode": "CO", 
     "boardingPolicy": "ZoneBoardingPolicy" 
    }, 
    "seller": { 
     "@type": "Airline", 
     "name": "United", 
     "iataCode": "UA" 
    }, 
    "departureAirport": { 
     "@type": "Airport", 
     "name": "San Francisco Airport", 
     "iataCode": "SFO" 
    }, 
    "departureTime": "2017-03-04T20:15:00-08:00", 
    "arrivalAirport": { 
     "@type": "Airport", 
     "name": "John F. Kennedy International Airport", 
     "iataCode": "JFK" 
    }, 
    "arrivalTime": "2017-03-05T06:30:00-05:00" 
    } 
} 
</script> 

回答

0

您需要更換reservationDreservationNumber

我不認爲這是一個支持boardingPolicy。在文檔它指出:「注:一些由谷歌所使用的模式仍在通過schema.org的標準化進程去,因此,可能會在未來改變。」

而不是賣家,你應輸入航空公司

我複製你的腳本,並修改了一些屬性,並用這個例子沒有收到任何錯誤(如果你試圖觸發谷歌現在卡,我建議使用日期/時間這幾個小時的路程):

<script type="application/ld+json"> 
 
{ 
 
    "@context": "http://schema.org", 
 
    "@type": "FlightReservation", 
 
    "reservationNumber": "RXJ34P", 
 
    "reservationStatus": "ReservationConfirmed", 
 
    "passengerPriorityStatus": "Fast Track", 
 
    "passengerSequenceNumber": "ABC123", 
 
    "securityScreening": "TSA PreCheck", 
 
    "underName": { 
 
\t "@type": "Person", 
 
\t "name": "Eva Green" 
 
    }, 
 
    "reservationFor": { 
 
\t "@type": "Flight", 
 
\t "flightNumber": "UA110", 
 
\t "provider": { 
 
\t "@type": "Airline", 
 
\t "name": "Continental", 
 
\t "iataCode": "CO" 
 
\t }, 
 
\t "airline": { 
 
\t "@type": "Airline", 
 
\t "name": "United", 
 
\t "iataCode": "UA" 
 
\t }, 
 
\t "departureAirport": { 
 
\t "@type": "Airport", 
 
\t "name": "San Francisco Airport", 
 
\t "iataCode": "SFO" 
 
\t }, 
 
\t "departureTime": "2016-03-04T20:15:00-08:00", 
 
\t "arrivalAirport": { 
 
\t "@type": "Airport", 
 
\t "name": "John F. Kennedy International Airport", 
 
\t "iataCode": "JFK" 
 
\t }, 
 
\t "arrivalTime": "2016-03-05T06:30:00-05:00" 
 
    } 
 
} 
 
</script>

0

我發現了一個JSON-LD和微觀例如鏈接,谷歌接受:

https://developers.google.com/gmail/markup/reference/flight-reservation

<script type="application/ld+json"> 
 
{ 
 
    "@context": "http://schema.org", 
 
    "@type": "FlightReservation", 
 
    "reservationNumber": "RXJ34P", 
 
    "reservationStatus": "http://schema.org/Confirmed", 
 
    "underName": { 
 
    "@type": "Person", 
 
    "name": "Eva Green" 
 
    }, 
 
    "reservationFor": { 
 
    "@type": "Flight", 
 
    "flightNumber": "110", 
 
    "airline": { 
 
     "@type": "Airline", 
 
     "name": "United", 
 
     "iataCode": "UA" 
 
    }, 
 
    "departureAirport": { 
 
     "@type": "Airport", 
 
     "name": "San Francisco Airport", 
 
     "iataCode": "SFO" 
 
    }, 
 
    "departureTime": "2017-03-04T20:15:00-08:00", 
 
    "arrivalAirport": { 
 
     "@type": "Airport", 
 
     "name": "John F. Kennedy International Airport", 
 
     "iataCode": "JFK" 
 
    }, 
 
    "arrivalTime": "2017-03-05T06:30:00-05:00" 
 
    } 
 
} 
 
</script>