Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions types/FluentJSONSchema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type FORMATS = {
TIME: 'time'
DATE: 'date'
DATE_TIME: 'date-time'
ISO_TIME: 'iso-time'
ISO_DATE_TIME: 'iso-date-time'
}

export type JSONSchema =
Expand Down
2 changes: 2 additions & 0 deletions types/FluentJSONSchema.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const schema = S.object()
)
.required()
.prop('age', S.mixed(['string', 'integer']))
.prop('isoTime', S.string().format(S.FORMATS.ISO_TIME))
.prop('isoDateTime', S.string().format('iso-date-time'))
.ifThen(S.object().prop('age', S.string()), S.required(['age']))
.readOnly()
.writeOnly(true)
Expand Down
Loading