XML : Best practice for embedding XML in JSON for an HTTP Response?

I'm working on a project where I ideally need to return a JSON object in an HTTP response where one field points to an xml snippet as a value. The object would look something like the following.

  {    "driver1_url" : "https://driver.url.download.link",    "driver2_url" : "https://driver2.url.download.link",    "xml_snippet" : "<xml><snippet>value</snippet></xml>"  }    

The xml snippet could be pretty long. Is it considered bad practice to embed XML into a JSON object? And if so, is there a better way to achieve what I've described?

No comments:

Post a Comment