Allow relative URLs for upload destinations in API responses
Update OpenAPI spec and generated schemas to permit relative paths for upload URLs, resolving validation errors with the local storage driver.
This commit is contained in:
@@ -802,6 +802,11 @@ export interface RequestUploadUrlBody {
|
||||
}
|
||||
|
||||
export interface RequestUploadUrlResponse {
|
||||
/**
|
||||
* Presigned upload destination. May be either an absolute URL (S3 driver) or a same-origin path starting with `/` (local driver) — the browser resolves the latter against `window.location.origin` so uploads always target the host serving the SPA.
|
||||
|
||||
* @minLength 1
|
||||
*/
|
||||
uploadURL: string;
|
||||
objectPath: string;
|
||||
metadata?: RequestUploadUrlBody;
|
||||
|
||||
@@ -4283,7 +4283,13 @@ components:
|
||||
properties:
|
||||
uploadURL:
|
||||
type: string
|
||||
format: uri
|
||||
minLength: 1
|
||||
description: >
|
||||
Presigned upload destination. May be either an absolute URL
|
||||
(S3 driver) or a same-origin path starting with `/` (local
|
||||
driver) — the browser resolves the latter against
|
||||
`window.location.origin` so uploads always target the host
|
||||
serving the SPA.
|
||||
objectPath:
|
||||
type: string
|
||||
metadata:
|
||||
|
||||
@@ -1061,7 +1061,12 @@ export const RequestUploadUrlBody = zod.object({
|
||||
});
|
||||
|
||||
export const RequestUploadUrlResponse = zod.object({
|
||||
uploadURL: zod.string().url(),
|
||||
uploadURL: zod
|
||||
.string()
|
||||
.min(1)
|
||||
.describe(
|
||||
"Presigned upload destination. May be either an absolute URL (S3 driver) or a same-origin path starting with `\/` (local driver) — the browser resolves the latter against `window.location.origin` so uploads always target the host serving the SPA.\n",
|
||||
),
|
||||
objectPath: zod.string(),
|
||||
metadata: zod
|
||||
.object({
|
||||
|
||||
Reference in New Issue
Block a user