Skip to content

Conversation

@realityking
Copy link
Contributor

Unfortunately #75 wasn't enough to get everything back to how it worked in 3.x 😢 With this change the tests for apiaryio/fury-adapter-swagger#158 finally pass.

I don't know this library well enough to write a test for this change. Any pointer would be appreciated.

@coveralls
Copy link

coveralls commented Apr 11, 2018

Coverage Status

Coverage remained the same at 95.026% when pulling cc4d361 on realityking:friendly-path into 1891b06 on BigstickCarpet:master.

3 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.026% when pulling cc4d361 on realityking:friendly-path into 1891b06 on BigstickCarpet:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.026% when pulling cc4d361 on realityking:friendly-path into 1891b06 on BigstickCarpet:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.026% when pulling cc4d361 on realityking:friendly-path into 1891b06 on BigstickCarpet:master.

@realityking
Copy link
Contributor Author

@BigstickCarpet Could you have a look at this one? Thanks!

@JamesMessinger
Copy link
Member

Hi @realityking. Sorry for taking so long to get to this.

Would you mind adding a test for this? I just want to make sure that I fully understand the issue, and a test will help with that. Plus, a test will ensure that I don't accidentally break it again in the future.

@kylef
Copy link

kylef commented Nov 5, 2018

@JamesMessinger The issue is that in swagger-parser@4 the error message:

throw ono('Error resolving $ref pointer "%s". \n"%s" not found.', path, withoutHash);

Contains the incorrect path for "root" (#/) references. In 3.x the following error was presented:

Error resolving $ref pointer "#/definitions/Whoops". \nToken "Whoops" does not exist. 

Whereas in 4.0 this contains the full path to the "current working directory":

Error resolving $ref pointer "/Users/kyle/Projects/apiaryio/fury-adapter-swagger/#/definitions/Whoops". \nToken "Whoops" does not exist. 
@kylef
Copy link

kylef commented Nov 5, 2018

To note, we're also using the options to disable external references:

const swaggerOptions = { dereference: { circular: 'ignore', }, resolve: { external: false, }, };
@jonluca
Copy link
Collaborator

jonluca commented Feb 3, 2023

AFAICT a refactor in the past changed this behavior. You'll get a MissingPointerException if the dereferencing hits a missing reference, and a manual call to .get on the reference will just reply with the path the user provided it. Closing for now

@jonluca jonluca closed this Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants