Introducing Satisfaketion: A zero-dependency fake data generation library

Hey everyone, my last post about my OpenAPI generator Kompendium was pretty popular so I figured I’d share another cool little library I’m working on.

I was looking for a fake data generator tool and came across a couple options, but they all had a couple weak points, be it lack of support, poor documentation, or lack of flexibility. So I went and built my own 🙂 Introducing… Satisfaketion

At its core, Satisfaketion consists of just two functional interfaces, `Generator` and `Mutator`.

fun interface Generator<R> { fun generate(): R }

fun interface Mutator<R, RR> { fun mutate(generator: Generator<R>): Generator<RR> }

Generators obviously allow you to generate data, while mutators are meant to provide a standardized way to modify existing generators, allowing extensive code reuse. Things like turning a generator for an object into a generator with a weighted nullability probability, or turning an object generator into a randomly sized list generator of that type.

Although I have the core functionality in place, I would really love to turn this into a full fledged Faker implemenetation, with tons of default generators available out-of-the-box. Unfortunately, that is just realllllly time consuming, so I figured I’d introduce the library now, in the hopes that other people are stoked about it and want to start adding their own generators 🙂

Would love for people to check it out, give any thoughts, and maybe open up a github issue if there is a generator you’d like to see provided

submitted by /u/ibuydipz
[link] [comments]