Open wai-lin opened 2 years ago
zod-to-json-schema is awesome and it seems to be a well maintained. I'll be choosing this library to generate OPEN API Schemas
for now.
Also get some inspiration from zod-to-openapi.
For now, I'm rethinking the api.
createRouter
would be defining the base OPEN API Schema
.router.path
will create a new pathhandler
function will generate the actual request
, response
schemas.So it would be like
const router = createRouter(Router(), {
basePath: '/v1',
info: {
title: 'My Awesome App API',
version: '1.0.0',
},
servers: [
{ url: 'http://localhost:8080/v1' }
],
})
Generate open api json from the
request
andresponse
schemas and also generate swagger ui route. And research about the type safe api client sdk generation. Also create custom Swagger UI if possible.