Fix BoxLang crash: expand file paths in $ref values before passing to SwaggerSDK#50
Fix BoxLang crash: expand file paths in $ref values before passing to SwaggerSDK#50Copilot wants to merge 2 commits intodevelopmentfrom
Conversation
boxlang@1 ColdBox ^8.0.0 Test Results16 tests +1 1 ✅ +1 1s ⏱️ ±0s For more details on these failures and errors, see this check. Results for commit 0e93d4d. ± Comparison against base commit 74b3ec6. ♻️ This comment has been updated with latest results. |
boxlang@1 ColdBox be Test Results16 tests +1 1 ✅ +1 1s ⏱️ ±0s For more details on these failures and errors, see this check. Results for commit 0e93d4d. ± Comparison against base commit 74b3ec6. ♻️ This comment has been updated with latest results. |
boxlang@be ColdBox be Test Results16 tests +1 1 ✅ +1 1s ⏱️ ±0s For more details on these failures and errors, see this check. Results for commit 0e93d4d. ± Comparison against base commit 74b3ec6. ♻️ This comment has been updated with latest results. |
…FileInputStream compatibility Co-authored-by: lmajano <137111+lmajano@users.noreply.github.com>
On BoxLang, CFML file functions (
fileExists,fileRead) implicitly callexpandPath(), but Java'sFileInputStream— used by SwaggerSDK to resolve$reffile references — does not. This causes a crash whenever a web-root-relative or double-slash path passes thefileExists()guard but fails inFileInputStream.fpath = "//resources/api/auth/authenticate.response.yml" fileExists(fpath) // true — BoxLang implicitly expandPath()s fileRead(fpath) // ok createObject("java", "java.io.FileInputStream").init(fpath) // ERROR createObject("java", "java.io.FileInputStream").init(expandPath(fpath)) // okChanges
models/RoutesParser.cfc—parseMetadataValue: ApplyexpandPath()to local file paths (non-HTTP) before returning a$refstruct. Handles:/includes/resources/schema.json~/responses/foo.yml(after~→samplesPath/substitution)/schema.json##500— only the file portion is expanded; the fragment is preserved and re-attached//resources/api/auth/foo.ymltest-harness/tests/specs/RoutesParserTest.cfc: New spec assertingparseMetadataValueproduces absolute expanded paths for all three path forms (web-root-relative, tilde-prefixed, with fragment).Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.