Skip to content

Renaming ez.file() to ez.download()#2667

Closed
RobinTail wants to merge 10 commits intomake-v24from
mv-download-schema
Closed

Renaming ez.file() to ez.download()#2667
RobinTail wants to merge 10 commits intomake-v24from
mv-download-schema

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

Here I'm addressing the possible confusion between ez.file() and the new schema of Zod 4 z.file().

The proprietary one is designed for depicting file content in response having the form of string or a buffer.
For the sake of consistency with ez.upload() I'm renaming it to ez.download().

@RobinTail RobinTail added this to the v24 milestone May 26, 2025
@RobinTail RobinTail added refactoring The better way to achieve the same result breaking Backward incompatible changes labels May 26, 2025
@RobinTail RobinTail marked this pull request as ready for review May 26, 2025 18:54
Comment thread express-zod-api/src/raw-schema.ts Outdated
export const ezRawBrand = Symbol("Raw");

const base = z.object({ raw: file("buffer") });
const base = z.object({ raw: download("buffer") });
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

should address buffer schema directly

@coveralls-official
Copy link
Copy Markdown

Coverage Status

coverage: 100.0%. remained the same
when pulling 9190d43 on mv-download-schema
into 3f7e02e on make-v24.

Copy link
Copy Markdown
Owner Author

@RobinTail RobinTail left a comment

Choose a reason for hiding this comment

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

perhaps, it would be even better to remove ez.file() completely, but expose the buffer schema with a suggestion to use .meta() for setting customized props depending on particular needs.

@RobinTail
Copy link
Copy Markdown
Owner Author

Doing #2668 instead

@RobinTail RobinTail closed this May 26, 2025
RobinTail added a commit that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Backward incompatible changes refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant