Forum Discussion

BostonKevin's avatar
BostonKevin
Contributor
6 years ago

Way to Model Response An Array of Different Objects With Identical Properties

Hi!   In Swagger Editor is there a way to model an array of objects each of which has identical properties but with different values for these properties?  This array is in a response to a delete...
  • RonRatovsky's avatar
    RonRatovsky
    6 years ago

    Okay, that will not produce what you want. Please read https://swagger.io/docs/specification/adding-examples/ for a deeper explanation on how to add examples to responses. It should give you enough information on the right steps. If you run into any issues, please share the definitiion you got to and we'll take it from there.

     

    As a side note - the Editor is intended to be used with YAML and not JSON. By using JSON, you will not get some of the benefits of the editor. Converting to YAML would be as simple as copying the JSON and pasting it again into the Editor. It will automatically detect it and ask if you want to convert it to YAML.