Phoenix swagger $$ref appears in swagger ui

I have this issue and I think its starts appearing after swagger 0.8.1 upgrade:

          {
             "token": ""123"
             "$$ref": "#/components/schemas/auth"
          }

Expected behaviour:

           {
             "token": ""123"
          }

Code:

            "responses": {
               "200": {
                 "examples": {
                   "application/json": {
                       "data": {
                          "$ref": "#/components/schemas/auth"
                           }
                      }
                  }
                }

I have found this issue on github for swagger and it’s suppose to be fixed.

Any suggestions or workaround?

Thanks

Any thoughts on this? @mbuhot

Which Swagger/OpenAPI library do you use and where you put that code?

I am using

                        :phoenix_swagger, "~> 0.8.1"

I put all the code inside the swagger.json file inside components.

    {
     "swagger": "2.0",
       "components": { 
         "schemas": {
            "auth_token_complete": {
              "token": "%%%%%%%%%%#########&&&&&&&&&",
              "exp": "2018-01-01 10:30AM"
              }
            }
          }
        }

I use this inside responses like this:

   "responses": {
      "200": {
        "examples": {
          "application/json": {
            "data": {
              "$ref": "#/components/schemas/auth_token_complete"
            }
          }
        }
      }         
    }

@script

I’m having trouble understanding the bug.

{
  "token": ""123"
  "$$ref": "#/components/schemas/auth"
}

I can’t tell if this is supposed to be elixir or json? It doesn’t look like valid syntax for either.

Expected behaviour:
    {
      "token": ""123"
    }

Where are you expecting to see this? In swagger-ui ?

Edit: Re-reading the thread title I see this is about swagger-ui.
The version included with phoenix_swagger is outdated, so if the swagger.json is valid it is probably a bug in swagger-ui.

You can try creating your own swagger-ui plug and see if that fixes the issue.