What library can I use to generate random mock data based on Open API spec inside a node application?

91
July 26, 2022, at 11:10 PM

I am looking for a library which would generate a mock data based on openapi spec (client side only). So the idea is not to have a separate local server, as it's done in openapi-mock-express-middleware, but rather have data to be generated on fly inside front-end application.

Something like this I guess:

const spec = someOpenApiMockGenerator('path/to/spec-file.yaml');
const anEndPointData = spec.mock("someEndpointName"); 
console.log(anEndPointData);
// expected output is same as in expressjs middlware mentioned above.

Rent Charter Buses Company
READ ALSO
TypeError: models[model].defineConstraints is not a function

TypeError: models[model].defineConstraints is not a function

I`m trying to undestand whats going on and why defineConstraints is not a functioncan someone help me ?

79
use nodejs var as json object statement?

use nodejs var as json object statement?

how do I use a nodejs var inside a json statement, I dont realy have the required vocabulary to explain but here is my simplifyed code:

97
Store files on mongodb database or server

Store files on mongodb database or server

I have a website built on MongoDB which has files to be downloaded by users other than images ( it can be a software installer orexe file

71