diff --git a/legacy/routes/xml.js b/legacy/routes/xml.js index a69f147c..4e2be7a3 100644 --- a/legacy/routes/xml.js +++ b/legacy/routes/xml.js @@ -272,6 +272,7 @@ var xmlService = function (coverage) { coverage['PutRootWithRefAndMetaXML'] = 0; coverage['jsonInputInXMLSwagger'] = 0; coverage['jsonOutputInXMLSwagger'] = 0; + coverage['GetWithXMsText'] = 0; router.get('/', function (req, res, next) { var comp = req.query.comp; @@ -579,6 +580,14 @@ var xmlService = function (coverage) { coverage['jsonOutputInXMLSwagger']++; res.status(200).json({ "id": 42 }); }); + + router.get('/x-ms-text', function (req, res, next) { + const xmsTextXML = + ` + I am text` + sendXmlBody(res, xmsTextXML); + coverage['GetWithXMsText']++; + }); }; xmlService.prototype.router = router; diff --git a/package.json b/package.json index 9697f8d1..b2b6731d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@microsoft.azure/autorest.testserver", - "version": "2.10.53", + "version": "2.10.54", "main": "./legacy/startup/www.js", "bin": { "start-autorest-express": "./.scripts/start-autorest-express.js", diff --git a/swagger/xml-service.json b/swagger/xml-service.json index 286a1c31..7256bbc6 100644 --- a/swagger/xml-service.json +++ b/swagger/xml-service.json @@ -748,6 +748,20 @@ } } } + }, + "/xml/x-ms-text": { + "get": { + "operationId": "xml_GetXMsText", + "description": "Get back an XML object with an x-ms-text property, which should translate to the returned object's 'language' property being 'english' and its 'content' property being 'I am text'", + "responses": { + "200": { + "description": "Success.", + "schema": { + "$ref": "#/definitions/ObjectWithXMsTextProperty" + } + } + } + } } }, "definitions": { @@ -1551,6 +1565,30 @@ "type": "string" } } + }, + "ObjectWithXMsTextProperty": { + "description": "Contans property ", + "type": "object", + "properties":{ + "language": { + "xml": { + "attribute": true, + "name": "language" + }, + "type": "string", + "description": "Returned value should be 'english'" + }, + "content": { + "xml": { + "x-ms-text": true + }, + "description": "Returned value should be 'I am text'", + "type": "string" + } + }, + "xml": { + "name": "Data" + } } } } \ No newline at end of file