Google 电子邮件标记测试器无法验证 FlightReservation 的 JSON-LD

Google email markup tester fails to validate JSON-LD for FlightReservation

Google Email Markup fails to validate JSON-LD that I took from schema.org for 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>

您需要将 reservationD 替换为 reservationNumber

我认为 boardingPolicy 不受支持。在文档中指出“注意:Google 使用的某些模式仍在经历 schema.org 的标准化过程,因此将来可能会发生变化。"

您应该输入 airline 而不是 seller

我已经复制了你的脚本并修改了一些属性并且在这个例子中没有收到任何错误(如果你试图触发 Google Now 卡片,我建议使用 date/time几个小时后):

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "FlightReservation",
  "reservationNumber": "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"
 },
 "airline": {
   "@type": "Airline",
   "name": "United",
   "iataCode": "UA"
 },
 "departureAirport": {
   "@type": "Airport",
   "name": "San Francisco Airport",
   "iataCode": "SFO"
 },
 "departureTime": "2016-03-04T20:15:00-08:00",
 "arrivalAirport": {
   "@type": "Airport",
   "name": "John F. Kennedy International Airport",
   "iataCode": "JFK"
 },
 "arrivalTime": "2016-03-05T06:30:00-05:00"
  }
}
</script>

我找到了一个 link,其中包含 json-ld 和 Google 接受的微数据示例:

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>