forked from bump-sh/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: resolve accented filesystem path correctly in $RefParser lib
The internal `$refs` Class of the json-schema-ref-parser library stores paths in a URI encoded fashion. This is to prevent confusion between # hash internal references (mentioned in the full json path) and # characters in the filesystem path. This commit makes sure to fetch the parsed values from the `$refs` object from the `$refs.values()` function (instead of the `$refs.get($ref)` function). I got a bit confused with the internals of the lib as I expected to be able to provide the returned values of `$Refs.paths()` to the `$Refs.get()` function transparently. But this does not work for filesystem paths containing special characters. The best solution is thus to fetch the `$refs.values()` object which has decoded file path as keys. I.e. exactly what we need.
- Loading branch information
Showing
5 changed files
with
55 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
openapi: 3.0.0 | ||
info: | ||
description: | | ||
An OpenAPI definition for the GitLab REST API. | ||
version: v4 | ||
title: GitLab API | ||
|
||
paths: | ||
# ... | ||
|
||
|
||
# ACCESS REQUESTS (PROJECTS) | ||
/v4/projects/{id}/access_requests: | ||
$ref: 'v4/access_requests.yaml#/accessRequestsProjects' | ||
|
||
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
accessRequestsProjects: | ||
get: | ||
description: Lists access requests for a project | ||
parameters: | ||
- name: id | ||
in: path | ||
responses: | ||
'200': | ||
description: Successful operation | ||
content: | ||
'application/json': | ||
$ref: 'models/ProjectAccessResponse.yaml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
schema: | ||
title: ProjectAccessResponse | ||
type: object | ||
properties: | ||
id: | ||
type: integer | ||
usename: | ||
type: string | ||
example: | ||
- "id": 1 | ||
"username": "raymond_smith" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters