• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cdimascio / express-openapi-validator / 2447
91%

Build:
DEFAULT BRANCH: master
Ran 14 Feb 2021 11:59PM UTC
Jobs 3
Files 24
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
2447

push

travis-ci

web-flow
Add `serDes` setting : serialize and deserialize (#506)

* `serDes` setting allows to `serialize` response objects and `deserialize` request parameters or fields. It could resolve : #353 #465 #288 #246
Unit tests validate Date and MongoDb ObjectID.
Developers have choice to :
- only serialize response contents
- also deserialize request strings to custom objects

Frequent SerDes are defined in base.serdes.ts (date and date-time).

Documentation updated with this setting

* I don't know why there was a cloneDeep but it seems to be necessary in all cases.

* Fix validation problems with oneOf and force default SerDes when no SerDes are defined (force DateTime and Date serialization).

* Delete old code comments

* New test : If I answer with an object which serialize fails (here because I answer with an ObjectID instead of Date and no toISOString function exists), a 500 error is thrown.

* Add Date and date-time serialization by default in addition to other serDes settings.
Custom settings can also override date and date-time formats in order to also deserialize date and/or date-time on requests

* Add Date and date-time serialization by default in addition to other serDes settings.
Custom settings can also override date and date-time formats in order to also deserialize date and/or date-time on requests

* `serDes` option adaptation to be more user friendly
Test OK
Documentation is modified
I also changed my https://github.com/pilerou/mongo-serdes-js with a 0.0.3 version which is compliant to the design :
```javascript
serDes: [
      OpenApiValidator.baseSerDes.date.serializer,
      OpenApiValidator.baseSerDes.dateTime,
      MongoSerDes.objectid, // this configuration if we want to deserialize objectid in request and serialize it in response
      MongoSerDes.uuid.serializer, // this configuration if we only want to serialize on response
    ],
```

* When we add custom formats in serDes, they are automatically a... (continued)

1050 of 1238 branches covered (84.81%)

Branch coverage included in aggregate %.

1302 of 1382 relevant lines covered (94.21%)

401.57 hits per line

Jobs
ID Job ID Ran Files Coverage
1 2447.1 (COVERALLS_REPO_TOKEN=[secure] CODACY_PROJECT_TOKEN=[secure]) 14 Feb 2021 11:59PM UTC 0
89.77
Travis Job 2447.1
2 2447.2 (COVERALLS_REPO_TOKEN=[secure] CODACY_PROJECT_TOKEN=[secure]) 14 Feb 2021 11:59PM UTC 0
89.77
Travis Job 2447.2
3 2447.3 (COVERALLS_REPO_TOKEN=[secure] CODACY_PROJECT_TOKEN=[secure]) 15 Feb 2021 12:00AM UTC 0
89.85
Travis Job 2447.3
Source Files on build 2447
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #2447
  • b802dd1e on github
  • Prev Build on master (#2445)
  • Next Build on master (#2448)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc