-
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.
Merge pull request #25 from cuaklabs/feat/update-deref-return-type
Update dereferenceJsonSchema to return DereferencedSchemaResult
- Loading branch information
Showing
6 changed files
with
35 additions
and
8 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
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
10 changes: 9 additions & 1 deletion
10
packages/parser/json-schema-parser/src/jsonSchema/202012/index.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
import { parse } from './calculations/parse'; | ||
import { DereferencedSchemaResult } from './models/DereferencedSchemaResult'; | ||
import { DereferenceFunction } from './models/DereferenceFunction'; | ||
import { JsonSchemaParseResult } from './models/JsonSchemaParseResult'; | ||
import { ParseJsonSchemaOptions } from './models/ParseJsonSchemaOptions'; | ||
import { UriOptions } from './models/UriOptions'; | ||
|
||
export type { DereferenceFunction, ParseJsonSchemaOptions, UriOptions }; | ||
export type { | ||
DereferencedSchemaResult, | ||
DereferenceFunction, | ||
JsonSchemaParseResult, | ||
ParseJsonSchemaOptions, | ||
UriOptions, | ||
}; | ||
|
||
export { parse }; |
4 changes: 3 additions & 1 deletion
4
packages/parser/json-schema-parser/src/jsonSchema/202012/models/DereferenceFunction.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
import { JsonSchema } from '@cuaklabs/json-schema-types/2020-12'; | ||
|
||
import { DereferencedSchemaResult } from './DereferencedSchemaResult'; | ||
|
||
export type DereferenceFunction = ( | ||
schema: JsonSchema, | ||
baseUri: string, | ||
uri: string, | ||
) => Promise<JsonSchema>; | ||
) => Promise<DereferencedSchemaResult>; |
8 changes: 8 additions & 0 deletions
8
packages/parser/json-schema-parser/src/jsonSchema/202012/models/DereferencedSchemaResult.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { JsonSchema } from '@cuaklabs/json-schema-types/2020-12'; | ||
|
||
import { UriOptions } from '..'; | ||
|
||
export interface DereferencedSchemaResult { | ||
schema: JsonSchema; | ||
uriOptions: UriOptions; | ||
} |