rahulkataram
rahulkataram

Reputation: 31

MarkLogic 9 resource extension API not working without rs: namespace prefix

API: host:port?v1/rsources/content?id=1 The above API worked in ML 8

When we try to get the id in the code we dont get any values in ML 9

declare 
%roxy:params("")
function ext:get(
  $context as map:map,
  $params  as map:map
) as document-node()*
{
  let $params := rest:get-raw-query-params () + $params
let $id := map:get($params,"id")

API: host:port?v1/rsources/content?rs:id=1

But it is working on ML 9 if we include rs:

All our applications and services are built without rs: prefex This is critical and is there any way to fix this is ML 9

Upvotes: 0

Views: 75

Answers (2)

grtjn
grtjn

Reputation: 20414

I suspect something did change, and the raw query params are no longer passed through. It will be difficult to get around that. Alike Dave I recommend using the prefix according to docs, or add a proxy or tier that does that for you automatically.

HTH!

Upvotes: 0

Dave Cassel
Dave Cassel

Reputation: 8422

The surprising part here is that it ever worked -- the rs: prefix has been required since the REST API's introduction in MarkLogic 6. Is it possible that you have an application tier or custom rewriter that's been adding the rs: prefix while using MarkLogic 8?

The solution here is to go with the documented requirement to include the prefix.

Upvotes: 2

Related Questions