Swagger schema - anyone done this? non progress question

Posted by goo on 14-Oct-2019 09:45

In swagger I can add a schema by doing this:

responses:
200:
description: "successful operation"
schema:
type: array
items:
$ref: '#/definitions/Organization'

That will give me the following:

[
  {
    "ClientNo": 0,
    "ClientID": "string",
    "Name": "string",
    "Address": "string",
    "PostOffice": "string",
    "Logo": "string",
    "InvoiceNo": 0,
:
:

But if I want to add {"Organizations": in front of it, how can I do that?

{"Organizations":[
  {
    "ClientNo": 0,
    "ClientID": "string",
    "Name": "string",
    "Address": "string",
    "PostOffice": "string",
    "Logo": "string",
    "InvoiceNo": 0,
:
:



All Replies

Posted by goo on 15-Oct-2019 09:47

I changed it so that I only return an array.

Posted by Peter Judge on 15-Oct-2019 13:38

Will
type: object
work?
 
You'll probably also need to change what $ref looks like.
 

This thread is closed