Geocoder API:XSD 方案版本 6.2:SearchResponseViewType 包含 SearchResponseViewType 而不是 SearchResultsViewType
Geocoder API: XSD scheme version 6.2: SearchResponseViewType contains SearchResponseViewType in stead of SearchResultsViewType
我正在尝试为 Geocoder API 中使用的 Go 生成数据类型。
类型应在 XSD 方案中定义,可在此处找到:https://geocoder.api.here.com/6.2/xsd/LBSP-Search-Search.xsd
但是,当我开始将 xsd 方案与文档进行比较时,xsd 似乎并不正确。
文档:https://developer.here.com/documentation/geocoder/topics/resource-type-response-geocode.html
文档给了我这个结构:
"Response" of type SearchResponseType
- "MetaInfo" of type SearchResponseMetaInfoType
- "View" of type SearchResultsViewType
- "ViewID"
- "PerformedSearch"
- "Results" of type SearchResultType
另一方面,XSD 方案给了我这个:
"Response" of type SearchResponseType
- "MetaInfo" of type SearchResponseMetaInfoType
- "View" of type SearchResponseViewType
- "ViewId" of type int
- "Label" of type string
如果我没记错,SearchResponseType
中的 View
应该是 SearchResultsViewType
。 SearchResultsViewType
在 XSD 方案中定义但从未使用过。
XSD 中的 SearchResponseViewType
是 abstract
类型,因此不能直接在响应 XML 中使用。 SearchResultsViewType
派生自 SearchResponseViewType
抽象类型。这就是为什么您在文档中看到 SearchResultsViewType
而不是 SearchResponseViewType
的原因。
我正在尝试为 Geocoder API 中使用的 Go 生成数据类型。
类型应在 XSD 方案中定义,可在此处找到:https://geocoder.api.here.com/6.2/xsd/LBSP-Search-Search.xsd
但是,当我开始将 xsd 方案与文档进行比较时,xsd 似乎并不正确。
文档:https://developer.here.com/documentation/geocoder/topics/resource-type-response-geocode.html
文档给了我这个结构:
"Response" of type SearchResponseType
- "MetaInfo" of type SearchResponseMetaInfoType
- "View" of type SearchResultsViewType
- "ViewID"
- "PerformedSearch"
- "Results" of type SearchResultType
另一方面,XSD 方案给了我这个:
"Response" of type SearchResponseType
- "MetaInfo" of type SearchResponseMetaInfoType
- "View" of type SearchResponseViewType
- "ViewId" of type int
- "Label" of type string
如果我没记错,SearchResponseType
中的 View
应该是 SearchResultsViewType
。 SearchResultsViewType
在 XSD 方案中定义但从未使用过。
XSD 中的 SearchResponseViewType
是 abstract
类型,因此不能直接在响应 XML 中使用。 SearchResultsViewType
派生自 SearchResponseViewType
抽象类型。这就是为什么您在文档中看到 SearchResultsViewType
而不是 SearchResponseViewType
的原因。