Open programatix opened 3 months ago
Describe the bug Take the following example,
interface MyResquest { title: string; } interface MyResponse {...} type ApiSpec = Tspec.DefineApiSpec<{ paths: { "/endpoint": { post: { summary: "summary", description: "description", body: MyResquest , responses: { 201: MyResponse }, } } }, }>;
will result in the following,
"paths": { "/tasks": { "post": { "operationId": "...", "summary": "summary", "description": "description, "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string" } }, "additionalProperties": false, "required": [ "title" ] } } } }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TaskResponse" } } } } } } } }
I'm expecting it to use $ref instead, as such,
"paths": { "/tasks": { "post": { "operationId": "...", "summary": "summary", "description": "description, "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MyRequest" } } } }, "responses": { "201": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MyResponse" } } } } } } } }
Desktop (please complete the following information):
Additional context
Describe the bug Take the following example,
will result in the following,
I'm expecting it to use $ref instead, as such,
Desktop (please complete the following information):
Additional context