Skip to content

Restore type attributes on operations object to remain compliant with 1.2 spec.  #75

Description

@STRML

Discussion migrated from this commit comment.

As mentioned on this swagger-spec issue, this is required to be compliant with the spec but simply not quite clearly worded.

I don't think we should put this behind an option as we would essentially be allowing users to create noncompliant output, which can break outside tooling.

It seems to me that GoDaddy doesn't need multiple response types, so much as they need one response type and multiple error types. Would it not make sense to do something more like the following:

{
  "path": "/user/walletHistory",
  "operations": [{
    "method": "GET",
    "nickname": "getWalletHistory",
    "parameters": [],
    "responseMessages": [{
      "code": 200,
      "message": "Request was successful"
    }, {
      "code": 401,
      "message": "Unauthorized",
      "responseModel": "error"
    }, {
      "code": 404,
      "message": "Not Found",
      "responseModel": "error"
    }],
    "type": "array",
    "items": {
      "type": "transaction"
    }
  }]
}

This produces something like this, which eliminates the redundancy by excluding the responseModel from the 200.

Imgur

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions