Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sapiens-sapide/ca6fefa67a95eb6b2ff5ac5a297855c4 to your computer and use it in GitHub Desktop.
Save sapiens-sapide/ca6fefa67a95eb6b2ff5ac5a297855c4 to your computer and use it in GitHub Desktop.
route /v1/authentications pour test prism
"/v1/authentications": {
"post": {
"description": "Returns an auth token to build basicAuth for the provided credentials",
"tags": [
"users"
],
"security": [],
"consumes": [
"application/json"
],
"parameters": [
{
"name": "authentication",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"username": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"username",
"password"
],
"additionalProperties": false
}
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Successful authentication",
"schema": {
"type": "object",
"properties": {
"username": {
"type": "string",
"pattern": "stansab"
},
"user_id": {
"type": "string",
"description": "the user_id makes the 'username' for basicAuth"
},
"tokens": {
"type": "object",
"properties": {
"access_token": {
"type": "string",
"description": "the access_token makes the 'password' for basicAuth",
"pattern": "this is a mocked access_token"
},
"expires_in": {
"type": "integer",
"format": "int32"
},
"expires_at": {
"type": "string"
},
"refresh_token": {
"type": "string"
}
}
}
},
"additionalProperties": false,
"required": ["username", "user_id", "tokens"]
}
},
"401": {
"description": "Authentication error",
"schema": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"code": {
"type": "integer",
"format": "int32"
},
"name": {
"type": "string"
}
}
}
}
}
}
},
"x-stoplight": {
"beforeScript": null,
"afterScript": null,
"mock": {
"enabled": true,
"dynamic": false,
"statusCode": 200
}
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment