28 lines
632 B
CoffeeScript
28 lines
632 B
CoffeeScript
module.exports = ->
|
|
body:
|
|
login: type: 'string'
|
|
password: type: 'string'
|
|
|
|
response:
|
|
200:
|
|
type: 'object'
|
|
required: ['success']
|
|
properties:
|
|
success: type: 'boolean'
|
|
err: type: 'string'
|
|
user:
|
|
type: 'object'
|
|
required: ['user', 'login']
|
|
properties:
|
|
user: type: 'number'
|
|
login: type: 'string'
|
|
# user is required iff success
|
|
# err is required otherwise
|
|
if:
|
|
properties:
|
|
success:
|
|
const: true
|
|
then:
|
|
required: ['user']
|
|
else:
|
|
required: ['err']
|