Skip to content

feat: Add downloadFrom new fields (release 8.28)#256

Open
StevenRenaux wants to merge 5 commits into
sensiolabs:1.xfrom
StevenRenaux:feat/Release-8.28-Add-downloadFrom-new-fields
Open

feat: Add downloadFrom new fields (release 8.28)#256
StevenRenaux wants to merge 5 commits into
sensiolabs:1.xfrom
StevenRenaux:feat/Release-8.28-Add-downloadFrom-new-fields

Conversation

@StevenRenaux
Copy link
Copy Markdown
Collaborator

@StevenRenaux StevenRenaux commented Apr 10, 2026

Q A
Gotenberg API version ? 8.28
Bug fix ? no
New feature ? yes
BC break ? no
Issues Fix #...

Description

https://github.com/gotenberg/gotenberg/releases/tag/v8.28.0

Download From: Extended the downloadFrom JSON schema with a field property ("watermark", "stamp", "embedded", > or "") to route downloaded files to the appropriate form field bucket. The existing embedded boolean is preserved for
backward compatibility.

Comment thread src/Builder/Util/ValidatorFactory.php Outdated
@StevenRenaux StevenRenaux force-pushed the feat/Release-8.28-Add-downloadFrom-new-fields branch from 3e97eeb to 9739b7f Compare April 26, 2026 15:47
* Sets download from to download each entry (file) in parallel (URLs MUST return a Content-Disposition header with a filename parameter.).
*
* @param list<array{url: string, extraHttpHeaders?: array<string, string>}> $downloadFrom
* @param list<array{url: string, extraHttpHeaders?: array<string, string>, field?: ''|'watermark'|'stamp'|'embedded'}> $downloadFrom
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for next major version, we could propose constants to improve DX. (constant usage in traits was introduced in PHP 8.2 but Symfony 6.4 supports >=8.1).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is a fixed list maybe we could create an enum directly ? It would help giving sense to ''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course! 💯

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a EnumNormalizer to convert Enum to string.
About traits you listed, Metadata key can be anything (see #245) and Cookie/Webhook are not related to Gotenberg

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used in this context when the value is an argument to the method, and also using NativeEnumNodeBuilder in the configuration node.

In our case, to do this, during JSON normalization, we need to check if it's an enumeration, and then call the corresponding method in the supplement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And a dedicated NormalizerFactory::download ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment thread src/Builder/Util/ValidatorFactory.php Outdated
Comment thread src/Builder/Util/ValidatorFactory.php Outdated
Comment thread src/Builder/Util/ValidatorFactory.php Outdated
Copy link
Copy Markdown
Contributor

@Neirda24 Neirda24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After fixes asked form Hubert 👍

* Sets download from to download each entry (file) in parallel (URLs MUST return a Content-Disposition header with a filename parameter.).
*
* @param list<array{url: string, extraHttpHeaders?: array<string, string>}> $downloadFrom
* @param list<array{url: string, extraHttpHeaders?: array<string, string>, field?: ''|'watermark'|'stamp'|'embedded'}> $downloadFrom
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is a fixed list maybe we could create an enum directly ? It would help giving sense to ''

@StevenRenaux StevenRenaux force-pushed the feat/Release-8.28-Add-downloadFrom-new-fields branch from c1c5de7 to 1a5ff97 Compare May 8, 2026 21:26
@StevenRenaux StevenRenaux force-pushed the feat/Release-8.28-Add-downloadFrom-new-fields branch from 1a5ff97 to 1ac2058 Compare May 8, 2026 21:29
Comment thread src/Builder/Util/NormalizerFactory.php
Comment thread src/Builder/Util/ValidatorFactory.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants