moqada / simple-api-client-generator

API Client Generator from JSON Hyper Schema
MIT License
2 stars 3 forks source link

Assertion error on tv4@1.3.0 #29

Closed ideyuta closed 6 years ago

ideyuta commented 7 years ago

toString was added to the return value of validate from tv4@1.3.0.

Ref: https://github.com/geraintluff/tv4/commit/a00bee535ae7498becd53f9a8071c1cc0bdc4359

Problem

Current output code

const data = {};
assert.deepEqual(
   tv4.validateMultiple(
    data,
    { "properties": {}, "type": ["object"] }
  ),
  { errors: [], missing: [], valid: true }
);

tv4@1.2.7

no error

tv4@1.3.0

AssertionError: {
  toString: [Function: toString],
  errors: [],
  missing: [],
  valid: true
} deepEqual { errors: [], missing: [], valid: true }

Solution

  1. Fix tv4 version to 1.2.7 without modify this library.
  2. Modify this library to support tv4 version 1.3.0 or later.

What do you want ?

cc @moqada