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": { "android": {
"description": "The long URL to redirect to when the short URL is visited from a device running Android", "description": "The long URL to redirect to when the short URL is visited from a device running Android",
"type": "string", "type": "string",
"nullable": true "nullable": false
}, },
"ios": { "ios": {
"description": "The long URL to redirect to when the short URL is visited from a device running iOS", "description": "The long URL to redirect to when the short URL is visited from a device running iOS",
"type": "string", "type": "string",
"nullable": true "nullable": false
}, },
"desktop": { "desktop": {
"description": "The long URL to redirect to when the short URL is visited from a desktop browser", "description": "The long URL to redirect to when the short URL is visited from a desktop browser",
"type": "string", "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", "type": "object",
"required": ["android", "ios", "desktop"], "required": ["android", "ios", "desktop"],
"allOf": [{ "allOf": [{
"$ref": "./DeviceLongUrls.json" "$ref": "./DeviceLongUrlsEdit.json"
}] }]
} }

View file

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

View file

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

View file

@ -6,7 +6,7 @@
"Short URLs" "Short URLs"
], ],
"summary": "Create a short URL", "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": [ "parameters": [
{ {
"$ref": "../parameters/version.json" "$ref": "../parameters/version.json"