0

I am building an API Documentation with Swagger and I am writing directly in Notepad++ in the JSON it all woks fine but now I have a POST request that has a response example of type xml. This is the code that I have written

"/stareMesaj": 
    "post":{
        "summary":"Response for stareMesaj",
        "description":"Blablabla",
        "produces":
            "-application/xml",
        "responses":{
            "200":
                "description":"ok",
                "examples":
                    "application/xml":{"<book>aaa</book>"}}}

Can you please give me advice on what is wrong because when I convert it to html with redoc it doesnt show any response example on the right side of the page.

Thanks in advance

SECI
  • 103
  • 2
  • 10
  • This is not valid JSON, it's missing `{ }` and `[ ]` in many places. Use https://editor.swagger.io instead of Notepad++ to write OpenAPI definitions. – Helen Jan 16 '20 at 08:39
  • I wrote it after the swagger tutorial now, in swagger editor it shows on the right side the xml response example, but when I convert and download the json and copy the method and paste it in my project and convert it in html with redoc it doesnt show. For the json response examples it worked... any ideas ? – SECI Jan 16 '20 at 08:50
  • Please explain in more details how you "copy the method and paste it in my project and convert it in html with redoc it doesnt show." What exactly tools/libraries/commands you use, how your code looks like, etc. So that others can reproduce the issue. – Helen Jan 16 '20 at 09:02

0 Answers0