docfx icon indicating copy to clipboard operation
docfx copied to clipboard

Rest Swagger - $ref with `[` and `]` not parsed successfully

Open hellosnow opened this issue 10 years ago • 0 comments

When ref with "#/definitions/KeyValuePair[String,String]", the [ and ] are decoded to added as key in dict, but it's get without decoding.

Expected behavior: Swagger is parsed successfully. Actual behavior: Could not resolve reference '#/definitions/KeyValuePair[String,String]' in the document

{
  "definitions": {
    "A": {
      "type": "object",
      "properties": {
        "properties": {
          "description": "Properties",
          "type": "array",
          "items": {
            "$ref": "#/definitions/KeyValuePair[String,String]"
          }
        }
      }
    },
    "KeyValuePair[String,String]": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "readOnly": true
        },
        "value": {
          "type": "string",
          "readOnly": true
        }
      }
    }
  }
}

hellosnow avatar Jun 06 '16 11:06 hellosnow