温馨提示:本文翻译自stackoverflow.com,查看原文请点击:here api - Geocoder API: XSD scheme version 6.2: SearchResponseViewType contains SearchResponseViewType in stea
xsd here-api

here api - Geocoder API:XSD方案版本6.2:SearchResponseViewType在stea中包含SearchResponseViewType

发布于 2020-03-27 12:09:08

我正在尝试为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

如果我是正确的话,Viewin SearchResponseType应该是SearchResultsViewTypeSearchResultsViewType在XSD方案定义,但从未使用过。

查看更多

查看更多

提问者
Pieter_at_Applied-Maths
被浏览
72
HERE Developer Support 2019-07-04 16:41

SearchResponseViewType在XSD是一个abstract类型,因此不能在响应XML直接使用。SearchResultsViewType从派生SearchResponseViewType抽象类型。这就是为什么您看到SearchResultsViewType而不是SearchResponseViewType在文档中看到的原因