These are chat archives for APIs-guru/api-models

4th
Jun 2016
Sergey Tihon
@sergey-tihon
Jun 04 2016 15:15

In https://apis-guru.github.io/api-models/citrixonline.com/gotoassistseeit/0.9.0/swagger.json sligthly strange to see references from response to definition object

"responses": {
          "201": {
            "description": "The session has been created.",
            "schema": {
              "$ref": "#/definitions/Session"
            }
          },
          "401": {
            "$ref": "#/definitions/Response_401_Unauthorized"
          },
          "403": {
            "$ref": "#/definitions/Response_403_Forbidden"
          }
  "definitions": {
  ....
    "Response_401_Unauthorized": {
      "description": "Missing or invalid authorization header"
    },
    "Response_403_Forbidden": {
      "description": "You do not have the required permissions for this operation"
    },

why not to define them in top-level responses property and reference like this#/responses/Response_401_Unauthorize ?

Ivan Goncharov
@IvanGoncharov
Jun 04 2016 18:50
@sergey-tihon I think it incorrect
Important thing is to have validator that catch such errors
without it you can find such problems
We working on Linter for Swagger files
and will add this as one of the checks
but it's in prototype stage currently
Sergey Tihon
@sergey-tihon
Jun 04 2016 18:54
this schema broke my unit tests for parser)
Ivan Goncharov
@IvanGoncharov
Jun 04 2016 18:54
so it will be couple of months untill we will use it
If it's critical I can fix it manually
?
Sergey Tihon
@sergey-tihon
Jun 04 2016 18:54
would be nice to have linter as a service online
Ivan Goncharov
@IvanGoncharov
Jun 04 2016 18:55
Yes we plan to do this
Sergey Tihon
@sergey-tihon
Jun 04 2016 18:55
cool
Ivan Goncharov
@IvanGoncharov
Jun 04 2016 18:55
Is it critical to fix right now?
Sergey Tihon
@sergey-tihon
Jun 04 2016 18:56
no, it is not supercritical, I already adjusted my parser to handle such cases
Ivan Goncharov
@IvanGoncharov
Jun 04 2016 18:56
cool we try to solve such problems in scalable way
Sergey Tihon
@sergey-tihon
Jun 04 2016 18:56
ok, thank you for your work
Ivan Goncharov
@IvanGoncharov
Jun 04 2016 18:57
so if some one report issue not just fix it manually for particular Swagger spec
but to add diagnostic rule for entire catalog
@sergey-tihon if you find other similar issues
please report it here
Sergey Tihon
@sergey-tihon
Jun 04 2016 19:00
ok, sure
Ivan Goncharov
@IvanGoncharov
Jun 04 2016 19:01
it super useful for linter development