We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{ "info": { "title": "Test swagger", "description": "Testing the Fastify swagger API", "version": "0.1.0" }, "paths": { "/api/method1": { "get": { "summary": "egg-like controller method1", "description": "egg-like controller method1", "parameters": [ { "name": "encryptedData", "type": "string", "description": "测试", "default": "2", "require": true, "in": "query" } ], "responses": { "200": { "description": "success", "schema": { "type": "object", "properties": { "status": { "type": "string" }, "result": { "type": "object", "properties": { "code": { "type": "number", "enum": [ "SUCCESS", "ERR_PARAM", "NOT_WECHAT_AUTH", "NOT_LOGIN", "ERROR", "FAIL_UPLOAD" ] }, "msg": { "type": "string" }, "data": { "type": "object", "properties": {}, "additionalProperties": false } }, "required": [ "code", "msg", "data" ], "additionalProperties": false } }, "required": [ "status" ], "additionalProperties": false } }, "400": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "result": { "type": "object", "properties": { "code": { "type": "number", "enum": [ "SUCCESS", "ERR_PARAM", "NOT_WECHAT_AUTH", "NOT_LOGIN", "ERROR", "FAIL_UPLOAD" ] }, "msg": { "type": "string" }, "data": { "type": "object", "properties": {}, "additionalProperties": false } }, "required": [ "code", "msg", "data" ], "additionalProperties": false } }, "required": [ "status" ], "additionalProperties": false } } }, "tags": [ "Egg" ], "security": [ { "ApiKeyAuth": [] } ] } }, "/api/method2": { "post": { "summary": "egg-like controller method1", "description": "egg-like controller method1", "parameters": [ { "name": "data", "description": "request body", "schema": { "type": "object", "properties": { "encryptedData": { "type": "string", "description": "测试", "default": "2", "require": true } } }, "in": "body" } ], "responses": { "200": { "description": "success", "schema": { "type": "object", "properties": { "status_code": { "type": "number", "description": "fdsfsdfdsfds" }, "data": { "type": "object" }, "message": { "type": "string" } } } }, "400": { "schema": { "type": "object", "properties": { "encryptedData": { "type": "string", "description": "测试", "default": "2" } }, "required": [ "encryptedData" ], "additionalProperties": false } } }, "tags": [ "Egg" ], "security": [ { "ApiKeyAuth": [] } ] } } }, "responses": {}, "definitions": {}, "tags": [ { "name": "user", "description": "User related end-points" } ], "swagger": "2.0", "securityDefinitions": { "api_key": { "type": "apiKey", "name": "Authorization", "in": "header" }, "swagger_auth": { "type": "oauth2", "authorizationUrl": "http://swagger.io/api/oauth/dialog", "flow": "implicit", "scopes": { "write:homes": "modify home info", "read:homes": "read home info" } } }, "allowUnknown": true, "externalDocs": { "url": "https://swagger.io", "description": "Find more info here" }, "host": "127.0.0.1:7001", "schemes": [ "http", "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "api_key": [] } ] }
response schema 中如果存在 additionalProperties 参数,生成的 ts 文件返回类型全是 AjaxPromise<{ [key: string]: any }> 删除所有 additionalProperties 就没问题
public apiMethod1Get = ( params: ParamsapiMethod1Get, opt?: ExtraFetchParams ): AjaxPromise<{ [key: string]: any }> => { const url = this.$basePath + `/api/method1`; const p: any = {}; p.query = {}; if ('encryptedData' in params) p.query.encryptedData = params.encryptedData; return ajax.ajax({ ...opt, method: 'GET', url, ...p }); };
The text was updated successfully, but these errors were encountered:
有预期解决时间不~ @gogoyqj
Sorry, something went wrong.
可能要等到 5 月了,最近比较忙
@smackgg 定位到是依赖的 swagger-codegen java 侧的算是一个 bug,有点复杂?建议可以先通过自动删除 additionalProperties 属性,解决这个问题
@gogoyqj 好的
No branches or pull requests
response schema 中如果存在 additionalProperties 参数,生成的 ts 文件返回类型全是 AjaxPromise<{ [key: string]: any }>
删除所有 additionalProperties 就没问题
The text was updated successfully, but these errors were encountered: