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

feat(zod-openapi): support "status code" #519

Merged
merged 3 commits into from
May 15, 2024

Conversation

yusukebe
Copy link
Member

@yusukebe yusukebe commented May 14, 2024

This may fix #513
Fix #518

After merging this PR, you have to set the status code with c.json() even if it's 200.

app.openapi(
  route,
  (c) => {
    const { id } = c.req.valid('param')
    return c.json(
      {
        id,
        age: 20,
        name: 'Ultra-man',
      },
      200 // You should specify the status code even if it's 200.
    )
  },

Copy link

changeset-bot bot commented May 14, 2024

🦋 Changeset detected

Latest commit: 2dbac8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hono/zod-openapi Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yusukebe yusukebe merged commit b03484b into main May 15, 2024
2 checks passed
@yusukebe yusukebe deleted the feat/zod-openapi-support-status-code branch May 15, 2024 01:06
@github-actions github-actions bot mentioned this pull request May 15, 2024
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.

[zod-openapi] RPC Mode Fails Without Request Parameters [zod/open-api] Problem with RPC types
1 participant