APIDevTools / json-schema-ref-parser

Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
https://apitools.dev/json-schema-ref-parser
MIT License
942 stars 226 forks source link

Fix handling of Windows absolute paths. #315

Closed matt1097 closed 11 months ago

matt1097 commented 1 year ago

This should fix #311 Added handling for absolute Windows file paths.

Added some additional tests around the url.fromFileSystemPath() to help catch this error in the future as no existing test was failing.

meepen commented 1 year ago

Kind of wondering, why is this library doing all this weird stuff with checking for windows and manual path fixing when there's available libraries that do this all for us? For example, node's in-built path library

sukeshpabolu commented 11 months ago

Hi please merge this if possible

gocarlos commented 11 months ago

@jonluca anything preventing this from being merged?

jonluca commented 11 months ago

Kind of wondering, why is this library doing all this weird stuff with checking for windows and manual path fixing when there's available libraries that do this all for us? For example, node's in-built path library

Yeah I agree - I think I'd prefer to just go through and fix all these issues directly. Will take a look right now, and if I don't see a fast way of fixing it I'll merge in this PR.

jonluca commented 11 months ago

Thanks for the PR - I'm going to release a breaking change soon with changes that should fix what this is targeting. In general I think we should revamp the windows logic, like @meepen said.

jonluca commented 11 months ago

https://github.com/APIDevTools/json-schema-ref-parser/pull/321