Skip to content

types: narrow code reply type based on schema#5380

Merged
mcollina merged 2 commits intofastify:mainfrom
hpx7:hp/narrow-reply-type-from-schema
Apr 3, 2024
Merged

types: narrow code reply type based on schema#5380
mcollina merged 2 commits intofastify:mainfrom
hpx7:hp/narrow-reply-type-from-schema

Conversation

@hpx7
Copy link
Copy Markdown
Contributor

@hpx7 hpx7 commented Mar 31, 2024

Closes #5378

Checklist

@climba03003
Copy link
Copy Markdown
Member

For others who would like to review this PR. We have two direction here

  1. Take a small step first and accept the incomplete of status code type-safe.
    That means 2xx or default remain no type-safe and exact status code would beneficial.

  2. Take a complete step and not accept a partial solution.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

I think this is an improvement worth doing.

@climba03003 climba03003 dismissed their stale review April 1, 2024 08:22

Option 1 - Baby step first

@hpx7 hpx7 changed the title Narrow code reply type based on schema types: narrow code reply type based on schema Apr 1, 2024
@hpx7
Copy link
Copy Markdown
Contributor Author

hpx7 commented Apr 2, 2024

@mcollina could you take another look?

@climba03003 climba03003 force-pushed the hp/narrow-reply-type-from-schema branch from 6d91e51 to 2541e57 Compare April 3, 2024 03:23
@climba03003
Copy link
Copy Markdown
Member

I have updated the branch by rebase.

@climba03003 climba03003 requested a review from a team April 3, 2024 03:24
@fox1t
Copy link
Copy Markdown
Member

fox1t commented Apr 3, 2024

I agree that at least fixing the 1. should be a tangible improvement anyway.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit c90ac14 into fastify:main Apr 3, 2024
@hpx7 hpx7 deleted the hp/narrow-reply-type-from-schema branch April 3, 2024 17:54
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 4, 2025

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type narrow on status().send() chains using Type-Providers schema

4 participants