cancel
Showing results for 
Search instead for 
Did you mean: 

Editor showing error, but jumping to the line doesn't seem to make sense

SOLVED
Highlighted
Occasional Contributor

Editor showing error, but jumping to the line doesn't seem to make sense

Hi, in my API:

https://app.swaggerhub.com/api/MeltingMosaic/BungieNetProxy/1.0.0

 

I'm seeing this error in the editor:

ptr must be a JSON Pointer

 

Clicking jump to line doesn't actually go anywhere there seems to be a problem.

 

Additionally, this API is showing up as Valid in the editor, but I cannot generate clients (or servers) for it. Nothing happens when I try.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Hello there!

 

Well, this is a bit embarrassing. You've hit an edge case.

 

The error itself is confusing and it's definitely pointing to the wrong line.

However, fear not!

 

I've forked your API and solved the issue(s), you can find it at https://app.swaggerhub.com/api/webron/BungieNetProxy/1.0.0.

 

The problem was with two references, at lines 481 and 505. The reference is missing a slash after the #.

So

- $ref: "#parameters/BungieNetApiKey"

 

should be

- $ref: "#/parameters/BungieNetApiKey"

 

Fix those two, and you're golden!

 

We're working on some major changes to the editor that will help avoid this issues... This update is very close.

 

On a slightly different subject - Bungie.net? 🙂

 

Thanks,

Ron


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

10 REPLIES 10
Highlighted
Moderator

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Hello there!

 

Well, this is a bit embarrassing. You've hit an edge case.

 

The error itself is confusing and it's definitely pointing to the wrong line.

However, fear not!

 

I've forked your API and solved the issue(s), you can find it at https://app.swaggerhub.com/api/webron/BungieNetProxy/1.0.0.

 

The problem was with two references, at lines 481 and 505. The reference is missing a slash after the #.

So

- $ref: "#parameters/BungieNetApiKey"

 

should be

- $ref: "#/parameters/BungieNetApiKey"

 

Fix those two, and you're golden!

 

We're working on some major changes to the editor that will help avoid this issues... This update is very close.

 

On a slightly different subject - Bungie.net? 🙂

 

Thanks,

Ron


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓

View solution in original post

Occasional Contributor

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Fantastic! Worked like a charm. 

 

As for bungie.net, Bungie has a rather voluminous API for the game Destiny, and I'm working on adding Swagger definitions for the Destiny API (just for fun). The API has like 300 endpoints, so I'm just writing out the popular ones that other Destiny app developers might use, and learning Swagger at the same time.

 

http://destinydevs.github.io/BungieNetPlatform/docs/Endpoints

Highlighted
Moderator

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Interesting, maybe I'll check your work when it's done 😉


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Highlighted
Occasional Contributor

Re: Editor showing error, but jumping to the line doesn't seem to make sense

I seem to have a very similar error in

 

https://app.swaggerhub.com/api/dunkc/hierarchy/1.0.0

 

The error I'm getting infers a null reference "Unable to get property 'parameters' of undefined or null reference" but the 'jump to line' takes me to a seemingly random spot in the Swagger file.

 

Maybe I've been staring at this too long but I can't actually see an invalid reference value either

Highlighted
Moderator

Re: Editor showing error, but jumping to the line doesn't seem to make sense

In your case the issue is different - you mix YAML and JSON in your spec, which is technically valid, but it is not well indented and YAML is sensitive to that.

 

The content directly under the `definitions`section needs to be modified. Take a look at https://app.swaggerhub.com/api/webron/hierarchy/1.0.0. Note that one you make the modifications, it will reveal other issues you'd need to fix.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Highlighted
Occasional Contributor

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Thanks for the quick response. I've been through the data definitions and indented them correctly but still have errors. When you say there's an error in the content directly under the 'definitions' section do you mean the first object i.e. the addressPhysical object? as I can't see what the problem with this is.

 

The reason for the mix of YAML and JSON is that the data architects like to provide their input (i.e. the data defintions in JSON) whereas I prefer to define the API in YAML. It's a matter of taste, I could go through the JSON and change it to YAML, but it's a long winded job.

Highlighted
Moderator

Re: Editor showing error, but jumping to the line doesn't seem to make sense

The link I shared is a copy of your spec with the fixed indentation, so you can use that as a reference.

 

As for JSON/YAML - it's very easy to convert between the two, there are multiple tools out there to do that. In the near future, we will also offer to convert JSON to YAML automatically when you import a JSON file, or even when you just paste a JSON snippet into an existing spec.


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Highlighted
Occasional Contributor

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Thanks, I've created a YAML version (you're right it wasn't too arduous) but now I get a schema errors "Not a valid Schema" and "A deterministic version of a JSON schema object".

 

The problem seems to be resolving the hierarchyParty definition from the hierarchyTier. In the API docs it shows as 'undefined'. However, the identical definition is also used in hierarchyRole and resolves ok. So I'm a bit confused.

 

There is a third error saying 'not a valid response definition' but I assume this is due to the schema problem.

 

I also had a few more similar errors where an array had a maxitems of 1 defined, removing this attribute removed the errors.

 

The new definition is at https://app.swaggerhub.com/api/dunkc/org-hierarchy/1.0.0. I'd appreciate it if you could shed any light on this please

 

 

Highlighted
Occasional Contributor

Re: Editor showing error, but jumping to the line doesn't seem to make sense

Finally got this error free....thanks for your help

New Here?
Join us and watch the welcome video: