json-schema-ref-parser icon indicating copy to clipboard operation
json-schema-ref-parser copied to clipboard

MissingPointerError: Token "ABC" does not exist.

Open YoungHo-Jo opened this issue 3 years ago • 2 comments

I am having trouble with MissingPointerError issues.

What I am doing is pasring java swagger docs generated from io.swaggerfox.sprinffox-swagger2. It gives json docs from http://localhost:8080/v2/docs.

if reference contains space at the end of the $ref then causes above issue. I tested dereferencing removing that space at $ref and it succeed.

example like below

{
 "swagger": "2.0",
  ...,
 "paths": {
    "somepath": {
        "post": {
            ...,
            "parameterer": [
               {
                   "in": "body",
                   ....,
                   "schema": {
                       "ref": "#/deifinitions/ABC "
                   }
               }
            ]
        }
    } 
 }
"definitions": {
    ...,
    "ABC ": {  // tested removing space at the end of "ABC "
      "type": "object",
      "properties": {
        "abc": {
          "type": "string"
        }
      },
      "title": "ABC "
    },
  ...
  }
}

YoungHo-Jo avatar Jan 26 '22 03:01 YoungHo-Jo

Is Springfox adding that space by itself? Can we send a pull request to Springfox to fix it? Do we need to support this trailing space?

philsturgeon avatar May 11 '22 21:05 philsturgeon

I'm having the same issue. In my schema, there are some data that comes from clients that may or may not contain trailing spaces. When it does, the reference breaks and everything that depends on the resulting object as well.

ChrisCWerner avatar Aug 01 '22 14:08 ChrisCWerner

Fixed in 11.3.1

jonluca avatar Mar 06 '24 07:03 jonluca