Closed thantos closed 1 year ago
Improving the command output to API Specification.
api.[method]
z.any
{ nullable: true }
ApiSpecification
{ "openapi": "3.0.1", "info": { "title": "eventual-tests", "version": "1" }, "servers": [ { "url": "https://ip98djye54.execute-api.us-east-1.amazonaws.com" } ], "paths": { "/hello3": { "post": { "operationId": "/hello3-POST", "parameters": [], "requestBody": { "content": {} }, "responses": {} } }, "/hello": { "get": { "operationId": "helloApi-get", "parameters": [], "requestBody": { "content": {} }, "responses": { "201": { "content": { "application/json": { "schema": { "type": "string" } } }, "description": "default output of hello command" } } } }, "/user/typed1/{userId}": { "get": { "operationId": "typed1-get", "parameters": [ { "in": "path", "name": "userId", "schema": { "type": "string", "description": "The user ID to retrieve" } } ], "requestBody": { "content": {} }, "responses": { "200": { "content": { "application/json": { "schema": { "nullable": true } } }, "description": "OK" } } } }, "/user/typed2/{userId}": { "get": { "operationId": "typed2-GET", "parameters": [ { "in": "query", "name": "detailed", "schema": { "type": "boolean" } }, { "in": "path", "name": "userId", "schema": { "type": "string" } } ], "requestBody": { "content": {} }, "responses": { "200": { "content": { "application/json": { "schema": { "type": "object", "properties": { "userId": { "type": "string" }, "createdTime": { "type": "string", "format": "date-time", "description": "Time the user was created" } }, "required": [ "userId", "createdTime" ] } } }, "description": "OK" } } } }, "/user/typedPut/{userId}": { "put": { "operationId": "typedPut-PUT", "description": "Update a user's info. Will write over whatever was set before.", "summary": "Update a user's info", "parameters": [ { "in": "query", "name": "ExpectedVersion", "schema": { "type": "number" } }, { "in": "path", "name": "userId", "schema": { "type": "string" } } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "age": { "type": "number" } }, "required": [ "age" ] } } } }, "responses": { "200": { "content": { "application/json": { "schema": { "nullable": true } } }, "description": "OK" } } } }, "/early-middleware-response": { "get": { "operationId": "/early-middleware-response-GET", "parameters": [], "requestBody": { "content": {} }, "responses": {} } }, "/modify-response-http": { "get": { "operationId": "/modify-response-http-GET", "description": "modify response middleware", "parameters": [], "requestBody": { "content": {} }, "responses": {} } } } }
Improving the command output to API Specification.
api.[method]
commands (pass through) to specify an array of output schemas, descriptions, and status codes.z.any
instead of undefined.{ nullable: true }
ApiSpecification
.