apigee-127 / sway

A library that simplifies OpenAPI (fka Swagger) integrations/tooling.
MIT License
190 stars 92 forks source link

Remove unused `faker` from the dependencies #233

Open rolfl opened 3 years ago

rolfl commented 3 years ago

faker is not used in the code base.

$ npx depcheck
Unused dependencies
* faker

This unused dependency simply adds bloat.

xDivisionByZerox commented 2 years ago

Can any maintainer confirm this (just in case)? I would appreciate this getting attention due to faker not being maintained anymore, but still gaining a lot of traffic.

I'm willing to provide a PR to fix this.

whitlockjc commented 2 years ago

I've not looked at the code in a while but we use faker indirectly via json-schema-faker: https://github.com/apigee-127/sway/blob/e9ad6e81af41f526567e9d5a0f150e59e429e513/lib/helpers.js#L28 to allow for Parameter#getSample to generate an example for a Parameter's schema. If faker is no longer maintained, either we need to find a replacement or we need to remove the ability to register custom format generators and likely sample generation.

xDivisionByZerox commented 2 years ago

I'm a team member from the faker-js/faker library which is considered the official fork from the old faker package. So I can assure you, other team members are already working on migrating the faker package in json-schema-faker (see here).

So your lib really just needs to remove the faker package from your dependencies in the package.json file.