Closed kingdun3284 closed 3 years ago
If you're inside a controller, you can inject the OpenApi
service directly to get the document:
import { dependency, OpenApi } from '@foal/core';
class Service {
@dependency
openApi: OpenApi;
foo() {
const document = this.openApi.getDocument(ApiController);
}
}
If you're outside of a controller/service, it's currently not possible. I will add an optional services
parameter in the next release.
Feature has been added to v2.5
Version of FoalTS: 2.4.0 Using createOpenApiDocument triggers error below:
someservice is a MIKRO ORM repository that set into service manager manually and being retrived by
@Depdency("someservice")
in controller. Afterall, I want to create a service manager manually and put into this function and found that the api has changed and different from foalts v1. Any suggestion to overcome this issue in v2?