You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried to use this library but in a test case I have found a problem with the circular schema.
To Reproduce
Use any circular schema, here an example:
// file tree.oas.ts// Open API Specificationexportdefault{openapi: "3.0.3",info: {version: "1",title: "Tree - OpenAPI 3.0",description:
"This is a sample of tree",termsOfService: "http://swagger.io/terms/",},paths: {"/tree": {get: {tags: ["tree"],summary: "Get tree",description: "",operationId: "getTree",responses: {"200": {description: "successful operation",content: {"application/json": {schema: {$ref: "#/components/schemas/Node",},},},},"404": {description: "Tree not found",},},},},},components: {schemas: {Node: {type: "object",properties: {number: {type: "integer",format: "int64",example: 10,},child: {$ref: "#/components/schemas/Node",},},},},},}asconst;
// file client.tsimport{createClient,Mutable}from'fets'importtreeOASfrom'./tree.oas'constclient=createClient<Mutable<typeoftreeOAS>>()constresponse=awaitclient['/tree'].get()// <--- HERE THERE IS AN ERROR TS2615 (circular reference for field "child")constbody=awaitresponse.json()console.log(body)
Expected behavior
Honestly, I don't know how to works deeply this library and I'm trying to understand, but I think that should be there a flag that avoids these scenarios with circular reference
Environment:
package-name...: fets
NodeJS: 18
The text was updated successfully, but these errors were encountered:
First of all, great job.
I have tried to use this library but in a test case I have found a problem with the circular schema.
To Reproduce
Use any circular schema, here an example:
Expected behavior
Honestly, I don't know how to works deeply this library and I'm trying to understand, but I think that should be there a flag that avoids these scenarios with circular reference
Environment:
package-name...
: fetsThe text was updated successfully, but these errors were encountered: