Closed skalyanapu-mtuity closed 6 years ago
Hi, XML validations are not included currently. I will not include them in v0.x.x but version v1.x.x will have an plug-in System which allow you to add features like the described one.
Okay, thanks for the information !!!
"XML validations are not included currently." -- keeping XML content validations apart , does "node-mock-server" also supports "application/xml" or "text/xml" content-type now i.e XML request and response methods along with JSON ??
Hi @skalyanapu-mtuity, yes node-mock-server supports xml. You just need to add an xml file in correct directory (see link folder-structure) and select them in the ui (see link expected-response).
Hello @smollweide Thank you! Yes it was working with XML , but I'm facing issue with error response,
If I create success.xml and select it as the expected response from UI by setting Content-Type header to "application/xml" it was working fine , similarly if create error.xml and set it as expected response from UI , then content-type was being set to application/json automatically though I set it to application/xml manually ? can you suggest what i'm doing wrong ?
Regards.
Hi @skalyanapu-mtuity, you are right this is a bug. I will fix it.
Published v0.19.1
Hi, Can we validate request body for POST requests ,For instance, If I'm sending XML data to POST method, I want to validate the presence of mandatory elements presence in post XML data to the API ?? If mandatory XML elements were missing I should throw exception accordingly, can we such validations ??
Regards.