-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix issue where we assumed json-ptrs were always in URI fragment…
… format. This introduces two fixes; first `jsonPaths.jsonPointerStripPrefix()` will now try to preserve the format of a json-ptr (i.e. if you give it a pointer in URI fragment format, it will return a pointer in URI fragment format.) Second, in src/oas3/Schema/validators, if we find a json-ptr that isn't in URI fragment format, we'll treat it properly, and convert it. fix #132
- Loading branch information
Showing
19 changed files
with
107 additions
and
16 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,25 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Run Current Mocha Test", | ||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha", | ||
"protocol": "inspector", | ||
"smartStep": true, | ||
"sourceMaps": true, | ||
"outputCapture": "std", | ||
"args": ["--colors", "${relativeFile}"], | ||
"env": { | ||
"RUN_FROM_SRC": "true", | ||
"NODE_ENV": "test", | ||
"SETUP_DOM": "true" | ||
}, | ||
"internalConsoleOptions": "openOnSessionStart" | ||
} | ||
] | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
declare module 'json-ptr' { | ||
export function encodePointer(path: string[]) : string; | ||
export function decode(pointer: string) : string[]; | ||
} | ||
export function encodePointer(path: string[]): string; | ||
export function decode(pointer: string): string[]; | ||
export function encodeUriFragmentIdentifier(path: string[]): string; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
...integration/controllers/echoController.ts → ...integration/controllers/echoController.ts
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
2 changes: 1 addition & 1 deletion
2
...ntegration/controllers/greetController.ts → ...ntegration/controllers/greetController.ts
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
2 changes: 1 addition & 1 deletion
2
test/integration/controllers/malformed.ts → ...tion/integration/controllers/malformed.ts
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
2 changes: 1 addition & 1 deletion
2
...ntegration/controllers/postWithDefault.ts → ...ntegration/controllers/postWithDefault.ts
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
2 changes: 1 addition & 1 deletion
2
...ation/controllers/postWithOptionalBody.ts → ...ation/controllers/postWithOptionalBody.ts
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
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...tegration/controllers/statusController.ts → ...tegration/controllers/statusController.ts
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
2 changes: 1 addition & 1 deletion
2
.../integration/customErrorFormattingTest.ts → .../integration/customErrorFormattingTest.ts
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
4 changes: 2 additions & 2 deletions
4
test/integration/customErrorHandler.ts → ...gration/integration/customErrorHandler.ts
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
File renamed without changes.
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,22 @@ | ||
# entry.yaml | ||
paths: | ||
Entry: | ||
get: | ||
operationId: fetch | ||
responses: | ||
default: | ||
description: Recursive entry. | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
properties: | ||
entry: | ||
$ref: '#/components/schemas/Recurse' | ||
components: | ||
schemas: | ||
Recurse: | ||
type: object | ||
properties: | ||
recurse: | ||
$ref: '#/components/schemas/Recurse' |
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,9 @@ | ||
// import { expect } from 'chai'; | ||
import * as path from 'path'; | ||
import * as exegesis from '../../../src'; | ||
|
||
describe('Issue 132 test', function() { | ||
it('should load a yaml file with recursive definitions', async function() { | ||
await exegesis.compileApi(path.resolve(__dirname, './openapi.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,7 @@ | ||
openapi: 3.0.1 | ||
info: | ||
title: Demo API | ||
version: 1.0.0 | ||
paths: | ||
/entry: | ||
$ref: 'entry.yaml#/paths/Entry' |
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