Skip to content

v1.1.0

Compare
Choose a tag to compare
@G4brym G4brym released this 21 Mar 13:25
· 17 commits to main since this release

What's Changed

  • feat: type inference support for data argument by @iann838 in #130

Now you can get full type hint and type check on the data argument of every endpoint, learn more here!

export class TaskFetch extends OpenAPIRoute {
  static schema = {
    parameters: {
      taskSlug: Path(Str, {
        description: 'Task slug',
      }),
    },
  }

  async handle(request: Request, env: any, context: any, data: DataOf<typeof TaskFetch.schema>) {
    // full type hint for query, path, header, and request body parameters!
    data.params.taskSlug
    
    // ...
  }
}

Full Changelog: v1.0.14...v1.1.0