Giter Site home page Giter Site logo

swagger-ui-layer's Issues

中文问题协助处理

以json格式提交数据:{"a":"小小","id":"id","title":"标题"},后台收到的值为:a=%E5%B0%8F%E5%B0%8F&id=id&title=%E6%A0%87%E9%A2%98,使用Postman正常

Swagger UI正常,但是swagger-ui-layer的html提示mapping不到

框架用的是Spring Boot 2.0
swagger-ui (2.8.0)和 swagger-ui-layer (0.0.4) 也都是用的最新版本
swagger-ui用 /swagger-ui.html可以正常访问,/v2/api-docs也可以正常返回结果

但是访问swagger-ui-layer,提示
No mapping found for HTTP request with URI [/docs.html] in DispatcherServlet with name 'dispatcherServlet'

请问应该设置哪里呢?

返回对象里嵌套对象不能显示完全

比如返回json对象
{"code":200,"msg":"消息","data":{"id":1,"userName":"admin"}}
显示出来的效果为

Properties Type Description
code integer 描述
data object 描述
msg string 描述

groupname的使用简单修改可以支持

//从URL获取参数
function getQueryString (name) {
return decodeURIComponent((new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(location.href)||[, ''])[1].replace(/+/g, '%20')) || null
}

var url = "v2/api-docs";
//获取group的值
if(getQueryString("group")) {
url += "?group=" + getQueryString("group");
}

修改docs.js中的ajax地址为上面的url,不知道管理有这样尝试过没

1.1.3版本与原生swagger-ui对比后发现的一些不足

本想打算用这个ui替换原生ui结果发现跟原生ui相比虽然整体上要好看一些,但同样存在不少地方反而比不上原生ui,最终暂时放弃对原生的替换。
主要问题如下:
1、@ApiModelProperty设置example参数无效,无法提供默认查询示例
2、debug中json参数只能自行输入,而原生ui只需要点击默认示例即可
3、原生ui在每次点击对应接口后url会发生变化,而swagger-ui-layer所有接口显示的url都一样,导致刷新页面后需要重新查找之前的接口
以上问题导致再开发和测试时使用反而不如原生ui好用,建议以后改进

另外建议添加对接口排序的支持。

脚本错误

Uncaught TypeError: Cannot read property 'url' of undefined
at Function.eval [as fn] (eval at L (jsrender.min.js:3), :19:24)
at F (jsrender.min.js:3)
at Function.S [as render] (jsrender.min.js:3)
at m.fn.init.Z [as render] (jsrender.min.js:3)
at Object.success (docs.js:24)
at j (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at x (jquery.js:4)
at b (jquery.js:4)
at Object.send (jquery.js:4)

不能正确解析response内非$ref的schema内容

案例:

{
  "get": {
    "summary": "第一个list功能",
    "deprecated": false,
    "produces": [
      "*/*"
    ],
    "operationId": "list3GET4997028859787988992",
    "responses": {
      "200": {
        "schema": {
          "type": "object",
          "properties": {
            "id": {
              "name": "id",
              "in": "formData",
              "description": "标识的desc",
              "required": true,
              "type": "string"
            },
            "createTime": {
              "name": "createTime",
              "in": "formData",
              "description": "时间的desc",
              "required": false,
              "type": "string"
            }
          }
        },
        "description": "返回profile列表"
      }
    },
    "description": "list的description",
    "parameters": [
      {
        "name": "id",
        "in": "formData",
        "description": "标识的desc",
        "required": true,
        "type": "string"
      },
      {
        "name": "createTime",
        "in": "formData",
        "description": "时间的desc",
        "required": false,
        "type": "string"
      }
    ],
    "tags": [
      "profile"
    ],
    "consumes": [
      "application/xml"
    ]
  }
}

在responses里面的schema不能正确的展示。 该问题在springfox-swagger-ui等其他工具上可以正确展示。如果schema内容为$ref指到definitions内的元素,展示没有问题。

$ref类型没有处理

例如,{"$ref":"#/definitions/WxJsapiSignature"},这种类型在UI中没有处理,恳求作者能够增加。

能不能把defaultValue 加进去

比如debug下需要token的支持 设置了全局的头部token后,在这个项目里无法显示。每次还要重新输入。希望您加上。这个版本超赞!!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.