Forum Discussion

cricketics's avatar
6 years ago

Adding simple text boxes to show my example

Hello everyone, I am very new to swagger and also new to editing a Yaml file.


I am trying to show on my documentation basically a simple text box which appears and in that I want to show a json text example so the user who uses the documentation can actually see the json text.


I have used x-example and it doesn't look proessional and also the text "x-example" appears. So I am trying to find a more efficient way and something that looks better. 


What i would like is basically something similar to how we call a definition  by putting  $ref: '#/definitions/definationname under schema and a textbox/terminal/command line kind of window appears showing the content, I want to do something similar where i can call some json file's content to appear or if thats not a possibility, I want to find a way where I can simply paste paste my json example in a text box for users to see under body which can replace my x-example. 


I would really appreciate if someone can help me with this please.






2 Replies

  • HKosova's avatar
    SmartBear Alumni (Retired)

    Hi cricketics,


    Could you please post your YAML and a screenshot of where in the docs you want to add the JSON example?

    • cricketics's avatar

      Hello Thanks for the response.


      Suppose this is my yaml  



      and this is the screenshot displaying the body which is calling a definiation.

      if i want to avoid the whole definiition proces and simply just paste small json file content there in the body, how do I go ahead and do that instead of bringing schema etc. Can i simply add an example with a text box showing my text(json content).


      All i am trying to achieve is just add few simple examples.


      In one example i want to show curl command which I want the users to try(not the one which appears in try it now), in other example I want to just show json text. 


      Whats the best strategy to edit my yaml and make this happen.