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

Support for other json content-types such as application/vnd.api+json, application/problem+json, etc. #645

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

DavidHavl
Copy link
Contributor

While writing a JSON:API compliant REST API using zod-openapi, I ran into an issue where the c.req.valid('json') does not contain any data when sending request with Content-Type 'application/vnd.api+json', even though I did specify it in route definition.
So I fixed it.

It now also supports other similar content-types such as:
'application/json'
'application/vnd.api+json'
'application/problem+json'
'application/csp-report+json'
'application/vnd.custom+json'
...

Copy link

changeset-bot bot commented Jul 16, 2024

🦋 Changeset detected

Latest commit: 053c471

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

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Member

@DavidHavl

Thanks! This is a good improvement. I'll merge now!

@yusukebe yusukebe merged commit f38a616 into honojs:main Jul 17, 2024
1 check passed
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.

2 participants