-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused JSON mimetypes in blackbox Data Service plumbing #1104
Comments
If both multiple and null returns are valid, set both nullable and multiple to true in the return property of the api declaration. By default, parameters and returns are non-nullable. |
Ahh, the issue is that there’s a mime-type registered for the xdmp.uriContentType('/helloWorld/helloWorld.api'); // application/vnd.marklogic-api+json This is kind of an oddball case because I’m actually working with the Array.from(xdmp.mimetypes()).filter(mime => /\+json/.test(mime.mimetype)); [
{
"mimetype": "application/rdf+json",
"extensions": "rj",
"format": "json"
},
{
"mimetype": "application/sparql-results+json",
"extensions": "srj",
"format": "json"
},
{
"mimetype": "application/vnd.marklogic-tde+json",
"extensions": "tdej",
"format": "json"
},
{
"mimetype": "application/vnd.marklogic-api+json",
"extensions": "api",
"format": "json"
}
] The workaround is to slap a |
Apologies, I misinterpreted the issue (which the original filing stated clearly). The client should certainly accept application/(.++)?json as a jsonDocument, object, or array |
I think the ml-development-tools/src/test/ml-modules/root/dbfunctiondef/positive/mimetype unit test is probably sufficient to verify the fix. I also noticed a bug in the conversion of handles that are bufferable but not resendable -- the converted BytesHandle value wasn't used -- and fixed that as well. |
ml-development-tools have been running fine after this fix. |
I’m stuck with my Data Service. I want it to return a sequence (potentially empty) of JSON docs, but I’m getting an error in the non-user-servicable plumbing around
Returned document as application/vnd.marklogic-api+json instead of application/json
. If I POST to the same endpoint I get a correct looking multipart, but the blackbox client seems to barf on this.Version of MarkLogic Java Client API
Version of MarkLogic Server
Java version
OS and version
Input
apis.json
apis.sjs
Test
Actual output
The text was updated successfully, but these errors were encountered: