go-openapi / spec

openapi specification object model
Apache License 2.0
389 stars 98 forks source link

`x-order` require value of `number` to be in quotes #162

Closed ChandanChainani closed 1 year ago

ChandanChainani commented 1 year ago
type User struct {
  // User name
  // Extensions:
  // x-order: 0
  Username string json:"username"
  // Password
  // Extensions:
  // x-order: 1
  Password string json:"password"
}

// userInfo request payload
// swagger:response userInfo
type swaggUserInfo struct {
  // in:body
  Body User
}

Output without quotes:

userInfo:
  properties:
    password:
      type: string
      x-go-name: Password
      x-order: 1
    username:
      type: string
      x-go-name: Username
      x-order: 0
type User struct {
  // User name
  // Extensions:
  // x-order: "0"
  Username string json:"username"
  // Password
  // Extensions:
  // x-order: "1"
  Password string json:"password"
}

// userInfo request payload
// swagger:response userInfo
type swaggUserInfo struct {
  // in:body
  Body User
}

Output with quotes:

userInfo:
  properties:
    username:
      type: string
      x-go-name: Username
      x-order: 0
    password:
      type: string
      x-go-name: Password
      x-order: 1