meeshkan / unmock-js

Fuzz test your REST API calls
https://unmock.io
93 stars 8 forks source link

Does not throw on broken format #389

Closed mikesol closed 4 years ago

mikesol commented 4 years ago

Fixes the fact that unmock cannot load a spec with a broken format.

Description

Tells json schema faker not to throw if there is a broken format.

How to test

One of the petstore yml files has been modified to include a broken format.

mikesol commented 4 years ago

Apologies, I should have been more clear. It's because in OpenAPI format can be anything, whereas in json-schema it is an enum of fixed values (int32, int64 for {"type":"integer"}, for example). As a result, when we pass an OpenAPI schema to json-schema-faker, there is a danger that a custom format will throw. This happened to me, for example, with the Stripe API, which has a custom format of "decimal" that caused unmock to crash.