0

Can swagger.json can be converted into the XSLT? Is there any tool for it? Swaagger.json Ui needs to be tested. But my testing needs one tool which can convert swagger.json to XSLT.

  • As the answer explains, this is not possible because OpenAPI/Swagger definitions and XSLT files are two very different things used for different purposes. What exactly are you trying to accomplish? If you provide more details about your use case, we might be able to suggest better solutions. – Helen Nov 25 '19 at 08:18

1 Answers1

1

there's a mistake in the question: swagger.json is a json file which describe the API interface. XSLT is a transformation file, code we could say. You may use a script to convert JSON to XML, or use XSLT to convert XML to JSON.

I'm not aware of any standard tool to convert JSON to XML, but I guess shouldn't too hard to build one.

EDIT: Converting JSON to XML in Java describes in 2 lines how to do it

Giuseppe B
  • 1,194
  • 8
  • 7
  • 1
    There are many tools to convert JSON to XML; they all have different ways of tackling the difficult edge cases (for example the fact that keys in a JSON object need not be valid XML names) and none of them produces results that are uniformly satisfactory. – Michael Kay Nov 24 '19 at 22:15