Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.13.0 #218

Merged
merged 1 commit into from
Feb 5, 2024
Merged

Release v2.13.0 #218

merged 1 commit into from
Feb 5, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Feb 5, 2024

Please merge this with a Merge Request to update master

v2.13.0

What's Changed

New Features 🎉

  • Introduce effectType by @samchungy in Introduce same effectType #217

    This library now has a new when dealing with Zod Effects. In most scenarios, our users were using to sanitise or transform while ensuring the type did not change, however, this library could not handle this.

    The new option allows this library to pick the input schema to produce a schema while ensuring that the input and output remain the same type.

    For example: when creating a response (output) schema for the following type this library cannot hook into the TypeScript
    compiler at runtime to understand that you wanted a string schema generated:

    which meant that you had to declare the following in order to get it to work:

    However, in the first example this could be dangerous if a user was to change the transform to no longer be the same type:

    The new type allows us to avoid this mistake:

  • Refactor Effect Handling by @samchungy in Refactor Effect Handling #211, Handle Lazy Effects #214

    This library now validates that effects used within registered Lazy schemas are not included in both input and output schemas. This could possibly be a breaking change if you were accidentally doing this.

    This library should also provide clearer errors when using Zod Effects with registered components which should make it easier to make dealing with effects more pleasant.

    Before:
    effectType

    After:

    effectTypesameinput.openapi({type: 'same'}).openapi({type: 'string'})

  • Add default as an effect by @samchungy in Default Effect Values #215, Add default effect type handling #216

    fix: default should be nonoptional in output state #175 added a change which would generate differences in the schema for input and outputs for a default schema. This may be a breaking change if you were using in a registered schema which is referenced in both a request and response schema. As such, can now also be used to change the rendered type.

Other Changes

New Contributors

Full Changelog: v2.12.0...v2.13.0

@github-actions github-actions bot added the chore This will not be included in the changelog label Feb 5, 2024
@samchungy samchungy merged commit e620a00 into master Feb 5, 2024
@samchungy samchungy deleted the release branch February 5, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore This will not be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant