-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prepopulate date #2121
Prepopulate date #2121
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2121 +/- ##
==========================================
+ Coverage 46.16% 46.20% +0.03%
==========================================
Files 429 429
Lines 20458 20487 +29
Branches 2385 2413 +28
==========================================
+ Hits 9445 9465 +20
- Misses 10049 10062 +13
+ Partials 964 960 -4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, some minor comments inline
Treat pre-population of dates as an extension for pre-population of defaults.
When schema has
default
keyword, its value is used instead ofundefined
.When schema has
{ format: 'date', dateformat: 'yyyy-MM-dd' }
, the current date is used instead ofundefined
.Implementation:
Additional work:
json-schema.js
to TypescriptBesides type conversion I added functions
scanSchemaAndPrefillValues
,getDefaultValue
and replacedmakeSchemaDefaultsSetter