Hi,

I have this rather simple json response, in my swagger file I want to write 
the definition that matches the response.
I got stuck - probably because because I am new to swagger.

so at the end of the example below i want the definition for this json 
response

{"Data":{"Login":[{"name":"Doe","firstname":"John","id":461199,
"passhash-expiry-utc":"20170223163054"}]}}


below is how my swagger looks now. Can anyone get my back on track by 
providing an example on how to write the definition?

thanks!

swagger: '2.0'
info:
 version: ' 1.13.0003.00'
 title: test (Simple)
 description: An API 
  termsOfService: 
  contact:
   name: Contoso
   email: [email protected]
   url: http://mydomain.com
 license:
   name: MIT
   url: http://opensource.org/licenses/MIT
host: mydomain.com
basePath: /api
schemes:
 - http
 - https
consumes:
 - application/json
produces:
 - application/json
paths:
 /login:
   get:
     description: 
        'Returns basis user properties and passhash expiry date/time stamp
       
       as 
        
        
{"Data":{"Login":[{"name":"Doe","firstname":"John","id":461199,"passhash-expiry-utc":"20170223163054"}]}}
       
       '
     operationId: login
     produces:
       - application/json
     parameters:
       - name: pswauth
         in: query
         description: pswauthstring
         required: true
         type: string
     responses: 
        '200':
         description: login response
         schema:
           type: array
           items:
             $ref: '#/definitions/Login'
       'default':
         description: unexpected error
         schema:
           $ref: '#/definitions/errorModel'
definitions:
 errorModel:
   type: object
   required:
     - code
     - message
   properties:
     code:
       type: integer
       format: int32
     message:
       type: string
 Login:
   type: object
   required:
     - code
     - message
   properties:
     code:
       type: integer
       format: int32
     message:
       type: string



-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to