Hawkbat / VTubeStudioJS

An implementation of the VTube Studio API for Node and browser JS
MIT License
46 stars 2 forks source link

Fix validation implementation #8

Closed satetsu888 closed 2 years ago

satetsu888 commented 2 years ago

Hi, I got below error during initialize ApiClient

Uncaught (in promise) Error: options.0 must be set
    at validate (validation.js?9521:42:1)
    at new ApiClient (endpoints.js?7cbd:91:1)
    ...

A code for validating object type in array schema seems not working correctly. schema is array and it looks like ['object', {...}], so we need to use subSchema to check each attributes and to call validation method recursively.

I also think, need some test code for that complex method if possible.

Hawkbat commented 2 years ago

You're right, that's my fault for not writing tests for that validation function. I'll push out this change and test it more thoroughly.

Hawkbat commented 2 years ago

Published as vtubestudio@3.0.2. Thank you for the upstream fix!