Help me to create swagger json file for below request.

{
  "data": {
    "app": {
      "version": "1.0.0",
      "name": "samco",
      "channel": "androidmarket",
      "build": "android-phone"
    },
    "hardware": {
      "keyboard": "QWERTY",
      "screen": "320 X 240",
      "model": "BlackBerry Curve 9220",
      "imei": "011234587362135",
      "display": "Touch Sensitive Optical Trackpad",
      "vendor": "RIM"
    }
  }
}

---------------------

Tried to write below file. unable to get nested object.

{
  "swagger": "2.0",
  "info": {
    "description": "This is a sample server Petstore server.  You can find 
out more about Swagger at [http://swagger.io](http://swagger.io) or on 
[irc.freenode.net, #swagger](http://swagger.io/irc/).  For this sample, you 
can use the api key `special-key` to test the authorization filters.",
    "version": "1.0.0",
    "title": "Swagger Petstore",
    "termsOfService": "http://swagger.io/terms/";,
    "contact": {
      "email": "apit...@swagger.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html";
    }
  },
  "host": "xxxxxxx",
  "basePath": "/xxxxxxxxx",
  "tags": [
    {
      "name": "2FA Login",
      "description": "How to login using xxxxxxxs",
      "externalDocs": {
        "description": "Find out more",
        "url": "--------"
      }
    }
  ],
  "schemes": [
    "http",
    "https"
  ],
  "paths": {
    "/Logout/EndSession/1.0.0": {
      "post": {
        "tags": [
          "EndSession"
        ],
        "summary": "User Logout service",
        "description": "Logout",
        "operationId": "LogoutOperation",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "description": "Request object",
            "required": true,
            "schema": {
              "$ref": "#/definitions/data"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Logout response"
          }
        }
      }
    }
  },
  "definitions": {
    "app_data": {
      "type": "object",
      "required": [
        "version",
        "name",
        "channel",
        "build"
      ],
      "properties": {
        "version": {
          "type": "string",
          "example": "1.0.0"
        },
        "name": {
          "type": "string",
          "example": "asddd"
        },
        "channel": {
          "type": "string",
          "example": "androidmarket"
        },
        "build": {
          "type": "string",
          "example": "android-phone"
        }
      }
    },
    "hardware_data": {
      "type": "object",
      "required": [
        "keyboard",
        "screen",
        "model",
        "imei",
        "display",
        "vendor"
      ],
      "properties": {
        "keyboard": {
          "type": "string",
          "example": "QWERTY"
        },
        "screen": {
          "type": "string",
          "example": "320 X 240"
        },
        "model": {
          "type": "string",
          "example": "BlackBerry Curve 9220"
        },
        "imei": {
          "type": "string",
          "example": "011234587362135"
        },
        "display": {
          "type": "string",
          "example": "Touch Sensitive Optical Trackpad"
        },
        "vendor": {
          "type": "string",
          "example": "RIM"
        }
      }
    },
    "data": {
      "type": "object",
      "required": [
        "hardware",
        "app"
      ],
      "properties": {
        "type": "object",
        "hardware": {
          "type": "object",
          "$ref": "#/definitions/hardware_data"
        },
        "app": {
          "type": "object",
          "$ref": "#/definitions/app_data"
        }
      }
    }
  }
}


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to