Updated API docs to reference the use of application/problem+json

This commit is contained in:
Alejandro Celaya
2019-11-28 19:37:22 +01:00
parent 5055ddf995
commit 60d3c09da5
13 changed files with 94 additions and 93 deletions

View File

@@ -150,7 +150,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -256,11 +256,32 @@
}
},
"400": {
"description": "The long URL was not provided or is invalid.",
"description": "Some of provided data is invalid. Check extra fields to know exactly what.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
"type": "object",
"allOf": [
{
"$ref": "./Error.json"
},
{
"type": "object",
"properties": {
"invalidElements": {
"$ref": "./InvalidShortUrlMeta.json"
},
"url": {
"type": "string",
"description": "A URL that could not be verified, if the error type is INVALID_URL"
},
"customSlug": {
"type": "string",
"description": "Provided custom slug when the error type is INVALID_SLUG"
}
}
}
]
}
}
}
@@ -268,7 +289,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}

View File

@@ -77,7 +77,7 @@
"400": {
"description": "The long URL was not provided or is invalid.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -89,9 +89,12 @@
}
},
"examples": {
"application/json": {
"error": "INVALID_URL",
"message": "Provided URL foo is invalid. Try with a different one."
"application/problem+json": {
"title": "Invalid URL",
"type": "INVALID_URL",
"detail": "Provided URL foo is invalid. Try with a different one.",
"status": 400,
"url": "https://invalid-url.com"
},
"text/plain": "INVALID_URL"
}
@@ -99,7 +102,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -111,7 +114,7 @@
}
},
"examples": {
"application/json": {
"application/problem+json": {
"error": "INTERNAL_SERVER_ERROR",
"message": "Unexpected error occurred"
},

View File

@@ -62,20 +62,10 @@
}
}
},
"400": {
"description": "Provided shortCode does not match the character set currently used by the app to generate short codes.",
"content": {
"application/json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
},
"404": {
"description": "No URL was found for provided short code.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -85,7 +75,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -153,7 +143,7 @@
"400": {
"description": "Provided meta arguments are invalid.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -163,7 +153,7 @@
"404": {
"description": "No short URL was found for provided short code.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -173,7 +163,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -242,7 +232,7 @@
"400": {
"description": "Provided meta arguments are invalid.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -252,7 +242,7 @@
"404": {
"description": "No short URL was found for provided short code.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -262,7 +252,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -302,26 +292,28 @@
"204": {
"description": "The short URL has been properly deleted."
},
"400": {
"422": {
"description": "The visits threshold in shlink does not allow this short URL to be deleted.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
},
"examples": {
"application/json": {
"error": "INVALID_SHORTCODE_DELETION",
"message": "It is not possible to delete URL with short code \"abc123\" because it has reached more than \"15\" visits."
"application/problem+json": {
"title": "Cannot delete short URL",
"type": "INVALID_SHORTCODE_DELETION",
"detail": "It is not possible to delete URL with short code \"abc123\" because it has reached more than \"15\" visits.",
"status": 422
}
}
},
"404": {
"description": "No short URL was found for provided short code.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -331,7 +323,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}

View File

@@ -78,7 +78,7 @@
"400": {
"description": "The request body does not contain a \"tags\" param with array type.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}

View File

@@ -132,7 +132,7 @@
"404": {
"description": "The short code does not belong to any short URL.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -142,7 +142,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}

View File

@@ -53,7 +53,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -140,7 +140,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -197,7 +197,7 @@
"400": {
"description": "You have not provided either the oldName or the newName params.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -207,7 +207,7 @@
"404": {
"description": "There's no tag found with the name provided in oldName param.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -217,7 +217,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
@@ -263,7 +263,7 @@
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}

View File

@@ -20,16 +20,6 @@
"responses": {
"302": {
"description": "Visit properly tracked and redirected"
},
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}
}

View File

@@ -29,16 +29,6 @@
}
}
}
},
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}
}

View File

@@ -40,16 +40,6 @@
}
}
}
},
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}
}

View File

@@ -28,16 +28,6 @@
}
}
}
},
"500": {
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}
}