Added swagger docs for visits summary in tags with stats

This commit is contained in:
Alejandro Celaya 2023-01-02 19:58:02 +01:00
parent ce9ec0d738
commit a5929ebb29
2 changed files with 22 additions and 8 deletions

View File

@ -1,5 +1,6 @@
{ {
"type": "object", "type": "object",
"required": ["tag", "shortUrlsCount", "visitsSummary", "visitsCount"],
"properties": { "properties": {
"tag": { "tag": {
"type": "string", "type": "string",
@ -9,9 +10,13 @@
"type": "number", "type": "number",
"description": "The amount of short URLs using this tag" "description": "The amount of short URLs using this tag"
}, },
"userAgent": { "visitsSummary": {
"$ref": "./VisitsSummary.json"
},
"visitsCount": {
"deprecated": true,
"type": "number", "type": "number",
"description": "The combined amount of visits received by short URLs with this tag" "description": "**[DEPRECATED]** Use visitsSummary.total instead"
} }
} }
} }

View File

@ -45,7 +45,7 @@
{ {
"name": "orderBy", "name": "orderBy",
"in": "query", "in": "query",
"description": "To determine how to order the results.<br /><br />**Important!** Ordering by `shortUrlsCount` or `visitsCount` has a [known performance issue](https://github.com/shlinkio/shlink/issues/1346) which makes loading a subset of the list take as much as loading the whole list.<br />If you plan to order by any of these fields, it's worth loading the whole list with no pagination.", "description": "To determine how to order the results.<br /><br />**Important!** Ordering by `shortUrlsCount`, `visits` or `nonBotVisits` has a [known performance issue](https://github.com/shlinkio/shlink/issues/1346) which makes loading a subset of the list take as much as loading the whole list.<br />If you plan to order by any of these fields, it's worth loading the whole list with no pagination.",
"required": false, "required": false,
"schema": { "schema": {
"type": "string", "type": "string",
@ -54,8 +54,10 @@
"tag-DESC", "tag-DESC",
"shortUrlsCount-ASC", "shortUrlsCount-ASC",
"shortUrlsCount-DESC", "shortUrlsCount-DESC",
"visitsCount-ASC", "visits-ASC",
"visitsCount-DESC" "visits-DESC",
"nonBotVisits-ASC",
"nonBotVisits-DESC"
] ]
} }
} }
@ -73,7 +75,6 @@
"required": ["data"], "required": ["data"],
"properties": { "properties": {
"data": { "data": {
"description": "The tag stats will be returned only if the withStats param was provided with value 'true'",
"type": "array", "type": "array",
"items": { "items": {
"$ref": "../definitions/TagInfo.json" "$ref": "../definitions/TagInfo.json"
@ -92,12 +93,20 @@
{ {
"tag": "games", "tag": "games",
"shortUrlsCount": 10, "shortUrlsCount": 10,
"visitsCount": 521 "visitsSummary": {
"total": 521,
"nonBots": 521,
"bots": 0
}
}, },
{ {
"tag": "shlink", "tag": "shlink",
"shortUrlsCount": 7, "shortUrlsCount": 7,
"visitsCount": 1087 "visitsSummary": {
"total": 1087,
"nonBots": 1000,
"bots": 87
}
} }
], ],
"pagination": { "pagination": {