feat(api): improve service urls update

- add force_domain_override functionality and docs
- delete service on creation if there is URL conflicts as otherwise we will have stale services (we need to create the service because we need to parse it and more)
This commit is contained in:
peaklabs-dev
2026-01-13 19:25:58 +01:00
parent 764d8861f6
commit 0628268875
3 changed files with 287 additions and 31 deletions

View File

@@ -8904,6 +8904,11 @@
},
"type": "object"
}
},
"force_domain_override": {
"type": "boolean",
"default": false,
"description": "Force domain override even if conflicts are detected."
}
},
"type": "object"
@@ -8941,6 +8946,60 @@
"400": {
"$ref": "#\/components\/responses\/400"
},
"409": {
"description": "Domain conflicts detected.",
"content": {
"application\/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "Domain conflicts detected. Use force_domain_override=true to proceed."
},
"warning": {
"type": "string",
"example": "Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior."
},
"conflicts": {
"type": "array",
"items": {
"properties": {
"domain": {
"type": "string",
"example": "example.com"
},
"resource_name": {
"type": "string",
"example": "My Application"
},
"resource_uuid": {
"type": "string",
"nullable": true,
"example": "abc123-def456"
},
"resource_type": {
"type": "string",
"enum": [
"application",
"service",
"instance"
],
"example": "application"
},
"message": {
"type": "string",
"example": "Domain example.com is already in use by application 'My Application'"
}
},
"type": "object"
}
}
},
"type": "object"
}
}
}
},
"422": {
"$ref": "#\/components\/responses\/422"
}
@@ -9171,6 +9230,11 @@
},
"type": "object"
}
},
"force_domain_override": {
"type": "boolean",
"default": false,
"description": "Force domain override even if conflicts are detected."
}
},
"type": "object"
@@ -9211,6 +9275,60 @@
"404": {
"$ref": "#\/components\/responses\/404"
},
"409": {
"description": "Domain conflicts detected.",
"content": {
"application\/json": {
"schema": {
"properties": {
"message": {
"type": "string",
"example": "Domain conflicts detected. Use force_domain_override=true to proceed."
},
"warning": {
"type": "string",
"example": "Using the same domain for multiple resources can cause routing conflicts and unpredictable behavior."
},
"conflicts": {
"type": "array",
"items": {
"properties": {
"domain": {
"type": "string",
"example": "example.com"
},
"resource_name": {
"type": "string",
"example": "My Application"
},
"resource_uuid": {
"type": "string",
"nullable": true,
"example": "abc123-def456"
},
"resource_type": {
"type": "string",
"enum": [
"application",
"service",
"instance"
],
"example": "application"
},
"message": {
"type": "string",
"example": "Domain example.com is already in use by application 'My Application'"
}
},
"type": "object"
}
}
},
"type": "object"
}
}
}
},
"422": {
"$ref": "#\/components\/responses\/422"
}