Skip to content

Commit e7a58d0

Browse files
committed
feat: adds file type to json schema
1 parent 314e9f4 commit e7a58d0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/Files/DTO/File.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,11 @@ public static function getJsonSchema(): array
335335
'oneOf' => [
336336
[
337337
'properties' => [
338+
'fileType' => [
339+
'type' => 'string',
340+
'const' => FileTypeEnum::REMOTE,
341+
'description' => 'The file type.',
342+
],
338343
'mimeType' => [
339344
'type' => 'string',
340345
'description' => 'The MIME type of the file.',
@@ -347,10 +352,15 @@ public static function getJsonSchema(): array
347352
'description' => 'The URL to the remote file.',
348353
],
349354
],
350-
'required' => ['mimeType', 'url'],
355+
'required' => ['fileType', 'mimeType', 'url'],
351356
],
352357
[
353358
'properties' => [
359+
'fileType' => [
360+
'type' => 'string',
361+
'const' => FileTypeEnum::INLINE,
362+
'description' => 'The file type.',
363+
],
354364
'mimeType' => [
355365
'type' => 'string',
356366
'description' => 'The MIME type of the file.',
@@ -362,7 +372,7 @@ public static function getJsonSchema(): array
362372
'description' => 'The base64-encoded file data.',
363373
],
364374
],
365-
'required' => ['mimeType', 'base64Data'],
375+
'required' => ['fileType', 'mimeType', 'base64Data'],
366376
],
367377
],
368378
];

0 commit comments

Comments
 (0)