我想在這樣的招搖API-doc的數組引用一個對象(有更多的對象,但在相同的模式)使用參考得到這個錯誤:數組中招搖API文檔
error TS2345: Argument of type '{ paths: { path: string; module: any; }[]; app: any; apiDoc: { 'x-express-openapi-additional-midd...' is not assignable to parameter of type 'Args'.
Types of property 'apiDoc' are incompatible.
Type '{ 'x-express-openapi-additional-middleware': any[]; swagger: string; basePath: string; info: { ti...' is not assignable to type 'ApiDefinition'.
Types of property 'definitions' are incompatible.
Type '{ Error: { type: string; properties: { status: { type: string; }; message: { type: string; }; tra...' is not assignable to type 'DefinitionsObject | undefined'.
Type '{ Error: { type: string; properties: { status: { type: string; }; message: { type: string; }; tra...' is not assignable to type 'DefinitionsObject'.
Property 'Orders' is incompatible with index signature.
Type '{ type: string; properties: { client: { type: { type: string; }; }; metadata: { type: string; pro...' is not assignable to type 'SchemaObject'.
Types of property 'properties' are incompatible.
Type '{ client: { type: { type: string; }; }; metadata: { type: string; properties: { client: { type: s...' is not assignable to type '{ [name: string]: SchemaObject; } | undefined'.
Type '{ client: { type: { type: string; }; }; metadata: { type: string; properties: { client: { type: s...' is not assignable to type '{ [name: string]: SchemaObject; }'.
Property 'client' is incompatible with index signature.
Type '{ type: { type: string; }; }' is not assignable to type 'SchemaObject'.
Types of property 'type' are incompatible.
Type '{ type: string; }' is not assignable to type 'string | string[] | undefined'.
Type '{ type: string; }' is not assignable to type 'string[]'.
Property 'length' is missing in type '{ type: string; }'.
任何想法爲什麼?
'}'之前的逗號是否有效? – Helen