나는 매개 변수 유형을 지정하는 rest resource 확장 기능을 가지고 있습니다. 그러나 주목할 점은 POST 또는 GET에서 가져온 매개 변수가 매개 변수와 동일한 유형이 아니라는 것입니다 내 metadata.xml에 입력하십시오. 이들은 모두 xs : string입니다. 그러나 out-of-box 검색 API를 보면 매개 변수 유형을 존중합니다. 조금 더 파고 있었는데 /MarkLogic/rest-api/endpoints/config.xqy
에서 get-rsrc-list-query-rule()
은 metadata.xml에 지정된 메타 데이터 규칙을 얻지 못하고, 하지만 아웃 - 오브 - 박스 검색 나머지 API를 들어,Marklogic Rest 메타 데이터를 존중하지 않는 자원 확장
declare function conf:get-rsrc-list-query-rule() as element(rest:request) {
<rest:request
allow-post-alias="true"
fast-match="/*/config/resources"
uri="^/(v1|get-rsrc-list-query-ruleLATEST)/config/resources/?$"
endpoint="/MarkLogic/rest-api/endpoints/resource-list-query.xqy">
<rest:http method="GET">
<rest:param name="format" required="false" values="json|xml"/>
<rest:param name="refresh" required="false" as="boolean"/>
</rest:http>
</rest:request>
};
.. 올바른 규칙을 얻을 않습니다 박스 검색 나머지 API를-중은 오른쪽 규칙이
declare function conf:get-search-query-request-rule() as element(rest:request) {
<rest:request
allow-post-alias="true"
fast-match="/*/search"
uri="^/(v1|LATEST)/search(/)?$"
endpoint="/MarkLogic/rest-api/endpoints/search-list-query.xqy"
user-params="allow-dups">
<rest:http method="GET">
<rest:param name="q" required="false"/>
<rest:param name="format" required="false" values="json|xml"/>
<rest:param name="start" as="unsignedLong" required="false"/>
<rest:param name="pageLength" as="unsignedLong" required="false"/>
<rest:param name="category" required="false" repeatable="true"
values="content|metadata|{string-join(docmodcom:list-metadata-categories(),"|")}"/>
<rest:param name="options" as="string" required="false"/>
<rest:param name="collection" as="string" required="false" repeatable="true"/>
<rest:param name="directory" as="string" required="false" repeatable="false"/>
<rest:param name="view" as="string" values="metadata|results|facets|all|none"/>
<rest:param name="txid" as="string" required="false"/>
<rest:param name="database" required="false"/>
<rest:param name="transform" required="false"/>
<rest:param name="structuredQuery" required="false"/>
<rest:auth>
<rest:privilege>http://marklogic.com/xdmp/privileges/rest-reader</rest:privilege>
<rest:kind>execute</rest:kind>
</rest:auth>
</rest:http>
<rest:http method="POST">
<rest:param name="q" required="false"/>
<rest:param name="format" required="false" values="json|xml"/>
<rest:param name="category" required="false" repeatable="true"
values="content|metadata|{string-join(docmodcom:list-metadata-categories(),"|")}"/>
<rest:param name="start" as="unsignedLong" required="false"/>
<rest:param name="pageLength" as="unsignedLong" required="false"/>
<rest:param name="options" as="string" required="false"/>
<rest:param name="collection" as="string" required="false" repeatable="true"/>
<rest:param name="directory" as="string" required="false" repeatable="false"/>
<rest:param name="view" as="string" values="metadata|results|facets|all|none"/>
<rest:param name="txid" as="string" required="false"/>
<rest:param name="database" required="false"/>
<rest:param name="transform" required="false"/>
<rest:content-type>text/xml</rest:content-type>
<rest:content-type>text/json</rest:content-type>
<rest:content-type>application/xml</rest:content-type>
<rest:content-type>application/json</rest:content-type>
<rest:auth>
<rest:privilege>http://marklogic.com/xdmp/privileges/rest-reader</rest:privilege>
<rest:kind>execute</rest:kind>
</rest:auth>
</rest:http>
<rest:http method="HEAD"/>
<rest:http method="OPTIONS"/>
</rest:request>
};
I 전송을위한 반면 내 매개 변수 유형을 지정할 때 생각, 리소스 나머지 API는 유형을 집행합니다, 그렇지 않으면 오류가 발생하지만 그건 그렇지 않습니다 .. 그것은 밖에서 휴식 API를 않습니다 .
이 권리를 이해하지 못 했습니까? 이 모든게 잘못 됐어? 나머지 리소스 확장이 내 metadata.xml에 지정된 매개 변수 유형을 준수하도록 어떻게 지정합니까?
실행중인 MarkLogic 버전 (정확히)과 나머지 확장 프로그램 배포 방법에 대해 자세히 알려줄 수 있습니까? – grtjn
ML 버전은'8.0-5.4'이고 ml-gradle을 사용하여 배포하고 있습니다. '/ marklogic.rest.resource/crSearch/assets/metadata.xml'에'metadata.xml '이 있습니다. – Ravi