Reflected changes to visits stats in the swagger docs

This commit is contained in:
Alejandro Celaya 2023-01-02 12:35:15 +01:00
parent 37c8328eed
commit d734578f74
4 changed files with 23 additions and 7 deletions

View File

@ -38,7 +38,7 @@
"description": "**[DEPRECATED]** Use `visitsSummary.total` instead." "description": "**[DEPRECATED]** Use `visitsSummary.total` instead."
}, },
"visitsSummary": { "visitsSummary": {
"$ref": "./ShortUrlVisitsSummary.json" "$ref": "./VisitsSummary.json"
}, },
"tags": { "tags": {
"type": "array", "type": "array",

View File

@ -1,14 +1,22 @@
{ {
"type": "object", "type": "object",
"required": ["visitsCount", "orphanVisitsCount"], "required": ["nonOrphanVisits", "orphanVisits", "visitsCount", "orphanVisitsCount"],
"properties": { "properties": {
"nonOrphanVisits": {
"$ref": "./VisitsSummary.json"
},
"orphanVisits": {
"$ref": "./VisitsSummary.json"
},
"visitsCount": { "visitsCount": {
"deprecated": true,
"type": "number", "type": "number",
"description": "The total amount of visits received on any short URL." "description": "**[DEPRECATED]** Use nonOrphanVisits.total instead"
}, },
"orphanVisitsCount": { "orphanVisitsCount": {
"deprecated": true,
"type": "number", "type": "number",
"description": "The total amount of visits that could not be matched to a short URL (visits to the base URL, an invalid short URL or any other kind of 404)." "description": "**[DEPRECATED]** Use orphanVisits.total instead"
} }
} }
} }

View File

@ -3,7 +3,7 @@
"required": ["total", "nonBots", "bots"], "required": ["total", "nonBots", "bots"],
"properties": { "properties": {
"total": { "total": {
"description": "The total amount of visits that this short URL has received.", "description": "The total amount of visits.",
"type": "integer" "type": "integer"
}, },
"nonBots": { "nonBots": {

View File

@ -31,8 +31,16 @@
}, },
"example": { "example": {
"visits": { "visits": {
"visitsCount": 1569874, "nonOrphanVisits": {
"orphanVisitsCount": 71345 "total": 64994,
"nonBots": 64986,
"bots": 8
},
"orphanVisits": {
"total": 37,
"nonBots": 34,
"bots": 3
}
} }
} }
} }