karlvr/openapi-generator-plus-express-passport

Wire up generated code with express server

srogers2112 opened this issue · 1 comments

I really like the strongly typed parsing this template gave me for express routes (ie. get, post, etc). However I am struggling with how to wire this up with an with an express application.

I have searched fairly widely and tried a few things, but unable to get the function in the index.ts to be recognized and for express to be able to find the routes. Do you have any examples or references to do this?

Thanks in advance!

Found closed issue #5 (comment)
While it was not the same, i was able to create a ServiceImpl class like this:

import { ApiImplementation } from "./src/types";
import * as t from './src/api/v1/types';
import api from "./src/impl/v1";

export class ServiceImpl implements ApiImplementation {
	v1: t.V1Api = api;
}

So not sure it complete works (havent filled in any calls with real implementation yet), but promising.

Closing issue.