-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
My openapi.helper.ts file (which is located in: src/helpers/
:
import oapi from '@wesleytodd/openapi';
const openapi = oapi({
openapi: '1.0.0',
info: {
title: 'Rest Docs',
version: '1.0.0',
description: 'Rest description,
},
});
export default openapi;
Then inside my express app configuration file located in: src/app.ts
, I am passing the openapi export to the app.use:
Note my routes are on
v1/
app.use('/v1/', routes);
app.use(openapi);
I also tried:
app.use('/v1/', openapi, routes);
I also tried adding adding openapi to my routes export. routes.use(openapi)
but it still couldn't pick up the paths, like so:
routes.ts:
routes.use(`/myrouter`, openapi, farmRouter);
When trying to visit the <path>/openapi.json
, it always returns an empty 'paths' object.
{
"openapi": "1.0.0",
"info": {
title: 'Rest Docs',
version: '1.0.0',
description: 'Rest description,
},
"paths": {}
}
The libs I am using are:
I am using nodejs 16
& "express": "^4.17.1",
, "@wesleytodd/openapi": "^0.1.0",
Metadata
Metadata
Assignees
Labels
No labels