faker icon indicating copy to clipboard operation
faker copied to clipboard

Targeting more types and fields automatically using reflect

Open chrisprijic opened this issue 2 years ago • 1 comments

Is it useful to target property names, types, and tags with new methods in this library?

E.g.

  • A tag targeted by AddTagProvider which is an alias for AddProvider
  • a type by AddTypeProvider (reflect-based)
  • a field by AddFieldProvider matching field name?
  • leaves room for other types of strategies later

It would probably require providing different "targeting" strategies for determining faking values. I understand there'd have to be precedence for applicability too. I think each of these could be valuable, though I don't know if its considered applicable here.

I can provide some implementation/PR if this is within scope. I'm going to try things out tomorrow and come back with some more details.

chrisprijic avatar Aug 31 '23 06:08 chrisprijic

+1

(especially if you would like to fake values of a dependency where tags can't be used)

snorwin avatar Apr 17 '24 09:04 snorwin