i tried to use openapi-backend with express with this setup:
(req: ExpressRequest, res: ExpressResponse, next: NextFunction) => {
api.handleRequest(
{
method: req.method,
path: req.path,
query: req.query,
body: req.body,
headers: req.headers,
params: req.params,
},
req,
res,
);
}
with this schema:
import { Document } from "openapi-backend";
export const apiSchema: Document = {
openapi: "3.0.1",
info: {
title: "REST API",
version: "1",
},
servers: [
{
url: "/api/v1",
description: "API Version 1",
},
{
url: "/api/v2",
description: "API Version 2",
},
],
paths: {
"/attendance/subscribe": {
post: {
operationId: "postSubscribeAttendance",
summary: "Subscribe to attendance",
requestBody: {
content: {
"application/json": {
schema: {
type: "object",
required: ["callbackUrl"],
properties: {
callbackUrl: {
type: "string",
// format: "url",
example: "http://yourserver.com/send/callback/here",
},
},
},
},
},
},
responses: {
"200": {
description: "ok",
content: {
"text/plain": {
schema: {
type: "string",
},
},
},
},
},
},
},
},
};
but no luck
i tried to use
openapi-backendwith express with this setup:with this schema:
but no luck