Set more accurate swagger docs in terms of what props are required/nullable for device long URLs

This commit is contained in:
Alejandro Celaya 2023-01-22 12:35:07 +01:00
parent b0b9902f40
commit 9949bb654d
6 changed files with 26 additions and 6 deletions

View file

@ -4,17 +4,17 @@
"android": {
"description": "The long URL to redirect to when the short URL is visited from a device running Android",
"type": "string",
"nullable": true
"nullable": false
},
"ios": {
"description": "The long URL to redirect to when the short URL is visited from a device running iOS",
"type": "string",
"nullable": true
"nullable": false
},
"desktop": {
"description": "The long URL to redirect to when the short URL is visited from a desktop browser",
"type": "string",
"nullable": true
"nullable": false
}
}
}

View file

@ -0,0 +1,17 @@
{
"type": "object",
"allOf": [{
"$ref": "./DeviceLongUrls.json"
}],
"properties": {
"android": {
"nullable": true
},
"ios": {
"nullable": true
},
"desktop": {
"nullable": true
}
}
}

View file

@ -2,6 +2,6 @@
"type": "object",
"required": ["android", "ios", "desktop"],
"allOf": [{
"$ref": "./DeviceLongUrls.json"
"$ref": "./DeviceLongUrlsEdit.json"
}]
}

View file

@ -6,7 +6,7 @@
"type": "string"
},
"deviceLongUrls": {
"$ref": "./DeviceLongUrls.json"
"$ref": "./DeviceLongUrlsEdit.json"
},
"validSince": {
"description": "The date (in ISO-8601 format) from which this short code will be valid",

View file

@ -296,6 +296,9 @@
"type": "object",
"required": ["longUrl"],
"properties": {
"deviceLongUrls": {
"$ref": "../definitions/DeviceLongUrls.json"
},
"customSlug": {
"description": "A unique custom slug to be used instead of the generated short code",
"type": "string"

View file

@ -6,7 +6,7 @@
"Short URLs"
],
"summary": "Create a short URL",
"description": "Creates a short URL in a single API call. Useful for third party integrations.",
"description": "**[Deprecated]** Use [Create short URL](#/Short%20URLs/createShortUrl) instead",
"parameters": [
{
"$ref": "../parameters/version.json"