Skip to content

Releases: paolostyle/hono-zod-openapi

v0.5.0

13 Nov 10:24
9d28983
Compare
Choose a tag to compare

0.5.0 (2024-11-13)

Features

  • deps: upgrade zod-openapi to 4.0.0 (5f93eed)

Bug Fixes

  • adjust paths with params to the OpenAPI format (0f52006)
  • require hono ^4.6.10 as it includes fix that closes #15 (1617c09)

v0.4.2

02 Nov 23:03
5ab8b2c
Compare
Choose a tag to compare

0.4.2 (2024-11-02)

Miscellaneous Chores

  • fix JSR publishing through CI (667f13b)
  • include missing JSDocs to exported types (5a50697)

v0.4.1

31 Oct 15:50
c29cd42
Compare
Choose a tag to compare

0.4.1 (2024-10-31)

Bug Fixes

  • use NPM version of Hono to unblock JSR release (e9b13a5)

v0.4.0

31 Oct 15:23
67b171a
Compare
Choose a tag to compare

0.4.0 (2024-10-31)

Features

v0.3.1

23 Oct 13:55
Compare
Choose a tag to compare

0.3.1 (2024-10-22)

Features

Bug Fixes

v0.3.0

11 Oct 22:29
Compare
Choose a tag to compare

0.3.0 (2024-10-11)

⚠ BREAKING CHANGES

  • rename Operation type to HonoOpenApiOperation - technically breaking as it was exported, but realistically you wouldn't use it without a good reason.

Features

  • rename Operation type to HonoOpenApiOperation, export HonoOpenApiRequestSchemas (e2bdda1)

v0.2.1

11 Oct 21:22
Compare
Choose a tag to compare

0.2.1 (2024-10-11)

Features

  • export some types that might be useful for users (5ecd9f8)

Bug Fixes

  • allow Hono instances with different Env type parameter than default (f77869c), closes #2

v0.2.0

06 Oct 21:15
Compare
Choose a tag to compare

This release contains quite a lot of breaking changes and can be considered a rewrite of the previous API (I warned you). I do believe this should cover 98% of the cases and I think I'm aware of at least some part of these 2%, but I'm definitely looking for more feedback.

Refer to README to learn about the new API.

Breaking changes

  • openApi now accepts just a single argument, consolidating previous 3 arguments into one object.
    Before:

    openApi(
      z.object({ hello: z.string() }),
      { json: z.object({ name: z.string() }) },
      { tags: ['User'] },
    );

    After:

    openApi({
      tags: ['User'],
      request: {
        json: z.object({ name: z.string() }),
      },
      response: {
        200: z.object({ hello: z.string() }),
      },
    });

    It might look a bit more verbose now, but in majority of cases this will actually result in less code. You can also use defineOpenApiOperation function to define this object outside of the middleware and import it.

  • createOpenApi has been renamed to createOpenApiDocument

  • overrides field has been removed from the third argument of createOpenApi. The second argument accepts all the possible top-level OpenAPI fields (except openapi which is hardcoded to 3.1.0) instead, so you need to change e.g.:

    createOpenApi(app, {
      title: 'Example API',
      version: '1.0.0',
    });

    to

    createOpenApi(app, {
      info: {
        title: 'Example API',
        version: '1.0.0',
      },
    });

    Again, this looks like a bit more code here, but in majority of cases users would've added more fields than info anyway.

  • Response validation has been removed. I really doubt in usefulness of this feature and it horribly complicates everything on TypeScript level.