Documented first non-rest endpoint

This commit is contained in:
Alejandro Celaya 2018-12-09 15:18:10 +01:00
parent baeba54b06
commit c898cef277
2 changed files with 60 additions and 11 deletions

View File

@ -0,0 +1,36 @@
{
"get": {
"operationId": "shortUrl",
"tags": [
"URL Shortener"
],
"summary": "Short URL",
"description": "Represents a short URL. Tracks the visit and redirects tio the corresponding long URL",
"parameters": [
{
"name": "shortCode",
"in": "path",
"description": "The short code to resolve.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"302": {
"description": "Visit properly tracked and redirected"
},
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}
}
}

View File

@ -6,15 +6,20 @@
"version": "1.0" "version": "1.0"
}, },
"externalDocs": {
"url": "https://shlink.io/api-docs",
"description": "Find more info on how to start using this API here"
},
"servers": [ "servers": [
{ {
"url": "{schema}://{server}/rest", "url": "{scheme}://{host}",
"variables": { "variables": {
"schema": { "scheme": {
"default": "https", "default": "https",
"enum": ["https", "http"] "enum": ["https", "http"]
}, },
"server": { "host": {
"default": "" "default": ""
} }
} }
@ -51,35 +56,43 @@
"name": "Visits", "name": "Visits",
"description": "Operations to manage visits on short URLs" "description": "Operations to manage visits on short URLs"
}, },
{
"name": "URL Shortener",
"description": "Non-rest endpoints, used to be publicly exposed"
},
{ {
"name": "Authentication", "name": "Authentication",
"description": "Authentication-related endpoints" "description": "**[Deprecated]** Authentication-related endpoints"
} }
], ],
"paths": { "paths": {
"/v1/short-urls": { "/rest/v1/short-urls": {
"$ref": "paths/v1_short-urls.json" "$ref": "paths/v1_short-urls.json"
}, },
"/v1/short-urls/shorten": { "/rest/v1/short-urls/shorten": {
"$ref": "paths/v1_short-urls_shorten.json" "$ref": "paths/v1_short-urls_shorten.json"
}, },
"/v1/short-urls/{shortCode}": { "/rest/v1/short-urls/{shortCode}": {
"$ref": "paths/v1_short-urls_{shortCode}.json" "$ref": "paths/v1_short-urls_{shortCode}.json"
}, },
"/v1/short-urls/{shortCode}/tags": { "/rest/v1/short-urls/{shortCode}/tags": {
"$ref": "paths/v1_short-urls_{shortCode}_tags.json" "$ref": "paths/v1_short-urls_{shortCode}_tags.json"
}, },
"/v1/tags": { "/rest/v1/tags": {
"$ref": "paths/v1_tags.json" "$ref": "paths/v1_tags.json"
}, },
"/v1/short-urls/{shortCode}/visits": { "/rest/v1/short-urls/{shortCode}/visits": {
"$ref": "paths/v1_short-urls_{shortCode}_visits.json" "$ref": "paths/v1_short-urls_{shortCode}_visits.json"
}, },
"/v1/authenticate": { "/{shortCode}": {
"$ref": "paths/{shortCode}.json"
},
"/rest/v1/authenticate": {
"$ref": "paths/v1_authenticate.json" "$ref": "paths/v1_authenticate.json"
} }
} }