Hi Erik

Yes, it's custom transformation I am using wherein I am converting XML to JSON 
to ensure my raw xml will be shown in JSON format.

Everything is working fine in ML6 and in ML7. even though my JSON conversion is 
working, the content element is treating the JSON as string and wrapping it up 
with quotes (content: ""<<json value>> "")

I have seen the decorator module in ML 7 is adding new attributes (mimetype and 
format) which are getting values from URI i.e. it is getting the format from 
URI every time which I believe is bug. Because as we are passing in a parameter 
format=json we expect the API to treat the document as JSON.

I updated the decorator API code to test how it works by tracking back the URL 
using xdmp:get-request-url and get the specified format i.e. json and pass it 
to the format variable.

After me updating the code it started working and I am getting JSON response as 
expected.

As we are not supposed to change the MarkLogic Code I am trying to check 
whether it's a bug which will be resolved in future or I need to look for 
alternative approaches here.

Regards,
Gnana(GP)

Date: Tue, 26 Nov 2013 12:22:53 +0000
From: Erik Hennum <[email protected]>
Subject: Re: [MarkLogic Dev General] JSON issue in MarkLogic 7
To: MarkLogic Developer Discussion <[email protected]>
Message-ID:
        <dfdf2fd50bf5aa42adaf93ff2e3ca1850f9...@exchg10-be01.marklogic.com>
Content-Type: text/plain; charset="windows-1252"

Hi, Gnana:

This could be a bug, but it's hard to be sure without more detail.

Would I be right in assuming that you have created a custom snippeting 
transform?  v7 did include some work on snippeting for JSON.  Can you provide 
specifics about the input to the transform, the transform code, and the output 
from the transform?


Erik Hennum

________________________________
From: [email protected] 
[[email protected]] on behalf of 
[email protected] [[email protected]]
Sent: Tuesday, November 26, 2013 2:04 AM
To: [email protected]
Subject: [MarkLogic Dev General] JSON issue in MarkLogic 7

Hi

I recently updated my MarkLogic server from v6 to v7 and I got an issue with 
json conversion.

Details:
MarkLogic 6:
As part of REST-API, when we supply the parameter format=json, the entire 
response was getting converted into JSON irrespective of what we have in 
content node.

i.e. By default we get search suggestions but I used transformation to get the 
full document and converted them to JSON which ensured I get results in JSON 
format.

MarkLogic 7:
We now additionally have mimetype and format in JSON response which I believe 
are coming from REST decorator.

Even though when I supply format=json, the decorator is searching for document 
type and making it as xml format because of which raw content node is treated 
as string.

Is there any way we can fix this or is this what we need to live with?

Another question,
My assumption is whenever REST API is updated, MarkLogic will use version 
numbers like /v1/, /v2/?/LATEST to ensure we are not losing the old REST API. 
Is this not available now?

Gnana(GP)
This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to