Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion types/FluentJSONSchema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ type FORMATS = {
URI: 'uri'
TIME: 'time'
DATE: 'date'
DATE_TIME: 'date-time'
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