Skip to content

Commit

Permalink
rename type parameter in JSONSchemaType
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Sep 14, 2020
1 parent 0451fac commit 7142086
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/types/json-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type SomeJSONSchema = JSONSchemaType<Known, true>

export type PartialSchema<T> = Partial<JSONSchemaType<T, true>>

export type JSONSchemaType<T, Partial = false> = (T extends number
export type JSONSchemaType<T, _allRequired = false> = (T extends number
? {
type: "number" | "integer"
minimum?: number
Expand Down Expand Up @@ -53,7 +53,7 @@ export type JSONSchemaType<T, Partial = false> = (T extends number
type: "object"
// "required" type does not guarantee that all required properties are listed
// it only asserts that optional cannot be listed
required: Partial extends true ? (keyof T)[] : RequiredMembers<T>[]
required: _allRequired extends true ? (keyof T)[] : RequiredMembers<T>[]
additionalProperties: boolean | JSONSchemaType<T[string]>
properties?: {
[K in keyof T]-?: (JSONSchemaType<T[K]> & Nullable<T[K]>) | {$ref: string}
Expand Down

0 comments on commit 7142086

Please sign in to comment.