Giter VIP home page Giter VIP logo

go-ptx's People

Contributors

code-automation avatar minchao avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

go-ptx's Issues

$top in query must be of type string: "number"

執行 swagger generate 時拋出型別錯誤。

錯誤訊息:

$ swagger generate client -f ./oas.bike.json -t ./bike
2019/07/14 17:46:36 validating spec ./oas.bike.json
The swagger spec at "./oas.bike.json" is invalid against swagger specification 2.0. see errors :
- default value for $top in query does not validate its schema
- $top in query must be of type string: "number"

原因:

在 PTX 的 OAS 的定義中,$top 的型別為 string,但預設值卻是 integer 的 30

          {
            "name": "$top",
            "in": "query",
            "description": "取前幾筆",
            "type": "string",
            "default": 30
          }

處理方式:

先回報官方,在官方修正前,將預設值改為 string。

Enum 元素定義錯誤

查詢時發生錯誤:

panic: json: cannot unmarshal number into Go struct field ServiceDTOVersion2BikeBikeAvailability.ServieAvailable of type string

原因:

  1. 元素 ServieAvailable 的 type 定義為 string,但返回值為 integer。
  2. enum 定義錯誤,假設返回值正確,則應為 "enum": [0, 1]

定義

        "ServieAvailable": {
          "description": "服務狀態",
          "enum": [
            "0: 停止營運",
            "1: 正常營運"
          ],
          "type": "string"
        }

回應

    "ServieAvailable": 1,

處理方式:

已回報官方。

/v3/Bus/Schedule/City/{City}.get.parameters 缺少 enum 成員

Describe the bug

/v3/Bus/Schedule/City/{City}.get.parameters 缺少 enum 成員

"parameters": [
  {
    "name": "City",
    "in": "path",
    "description": "縣市",
    "required": true,
    "type": "string",
    "enum": [],
    "x-enum": {
      "Tainan": "臺南市"
    }
  }
]

應為:

"enum": [
  "Tainan"
]

To Reproduce

$ make spec
$ make validate

The swagger spec at "./oas.bus.v3.json" is invalid against swagger specification 2.0.
See errors below:
- "paths./v3/Bus/Schedule/City/{City}.get.parameters" must validate one and only one schema (oneOf). Found none valid
- paths./v3/Bus/Schedule/City/{City}.get.parameters.in in body should be one of [header]
- paths./v3/Bus/Schedule/City/{City}.get.parameters.enum in body should have at least 1 items

Additional context

已回報,等 PTX 修正。

oas.rail.v2.json is invalid against swagger specification 2.0

Describe the bug

The swagger spec at "./oas.rail.v2.json" is invalid against swagger specification 2.0.
See errors below:
- "THSRApi_AvailableSeatStatusList_1" is defined 2 times
- "THSRApi_AvailableSeatStatusList" is defined 2 times
- "SrcUpdateTime" is present in required but not defined as property in definition "Service.DTO.Version2.Rail.THSR.AvailableSeat"

已回報 PTX

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.