swagger-js-codegen
Version:
A Swagger codegen for JavaScript
181 lines (180 loc) • 6.33 kB
JSON
{
"swagger": "2.0",
"info": {
"version": "0.0.1",
"title": "title"
},
"host": "portal.28.io",
"basePath": "/api",
"schemes": [
"http"
],
"securityDefinitions": {
"oauth2": {
"type": "oauth2",
"scopes": {},
"flow": "password",
"tokenUrl": ""
}
},
"paths": {
"/auth": {
"post": {
"description": "Get token",
"operationId": "auth",
"parameters": [
{
"name": "grant_type",
"description": "Authorization grant type. Use <code>client_credentials</code> to create a token or <code>refresh_token</code> to refresh a token",
"required": true,
"type": "string",
"enum": ["client_credentials", "refresh_token"],
"in": "query"
},
{
"name": "email",
"description": "The account email. Mandatory if <code>grant_type=client_credentials</code>.",
"required": false,
"type": "string",
"in": "query"
},
{
"name": "password",
"description": "The account password. Mandatory if <code>grant_type=client_credentials</code>.",
"required": false,
"type": "string",
"in": "query"
},
{
"name": "refresh_token",
"description": "The <code>refresh_token</code> obtained in the last successful request to this endpoint. Mandatory if <code>grant_type=refresh_token</code>.",
"required": false,
"type": "string",
"in": "query"
}
],
"responses": {
"200": {
"description": "Token",
"schema": {
"$ref": "#/definitions/Authentication"
}
},
"security": [
{
"oauth2": []
}
],
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/Error"
}
},
"default": {
"description": "Error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
},
"/project": {
"get": {
"description": "Get secure",
"operationId": "getSecure",
"parameters": [
{
"name": "token",
"description": "Auth token",
"required": false,
"type": "string",
"in": "query"
}
],
"security": [
{
"oauth2": []
}
],
"responses": {
"200": {
"description": "Secure response returned"
},
"401": {
"description": "Unauthorized"
}
}
}
}
},
"definitions": {
"Authentication": {
"required": [
"token_type",
"expiration_date",
"access_token",
"refresh_token",
"project_tokens"
],
"properties": {
"token_type": {
"type": "string",
"description": "The API token type",
"enum": [
"bearer"
]
},
"expiration_date": {
"type": "date-time",
"description": "The expiration date of all the tokens in the response"
},
"access_token": {
"type": "string",
"description": "The API token"
},
"refresh_token": {
"type": "string",
"description": "The refresh token which can be used to refresh both the API and project tokens"
},
"project_tokens": {
"type": "ProjectTokens",
"description": "The project tokens which can be used to make request to the APIs on the project endpoints"
}
}
},
"Error": {
"required": [
"code",
"message"
],
"properties": {
"code": {
"type": "string",
"description": "The XQuery error code of the error"
},
"message": {
"type": "string",
"description": "A formatted string which contain the error code (always) and the module name, line and column-number and error description (when available)"
},
"description": {
"type": "string",
"description": "The error description"
},
"module": {
"type": "string",
"description": "The error module"
},
"line-number": {
"type": "string",
"description": "The error line number"
},
"column-number": {
"type": "string",
"description": "The error column number"
}
}
}
}
}