Skip to content

Customize the name of the root XML element #262

Description

@bajtos

At the moment, when producing a response in the XML format, strong-remoting always wrap the response body in <response> element (source code).

We should allow developers to customise the name of this root element, for example to produce a response body like this:

<foo>bar</foo>

A possible solution is to implement a new remoting setting at the shared-method level:

var fn = function(cb) {
  cb(null, 'bar');
};

setupRemoting(fn, {
  "accepts": [],
  "returns": { "type": "string", "root": true },
  "xml": { "rootElement": "myCustomName" } }
});

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions