You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a schema with a validation, then derive a generator for that schema.
running that generator produces values that do not meet the schemas validation.
Create a schema via the .transformOrFail function, then derive a generator from that schema
running the generator potentially produces no values, despite the condition for successful creation being something simple like strings longer than 5 characters
Potential solutions:
filter the generator over the validation to produce valid instances (It is dangerous to allow someone to create a filter that may never return a value, so this option seems bad)
Similar to one, for transformOrFail instances, keep creating until an instance is actually generated. Again dangerous if all cases fail.
The text was updated successfully, but these errors were encountered:
I've been surprised by the current behaviour, actually.
Don't know if it's possible but a solution might be to provide a generator for each validation and combine them.
It looks like it's what refined-scalacheck does (and it's not just filters)
Current behavior:
Create a schema with a validation, then derive a generator for that schema.
running that generator produces values that do not meet the schemas validation.
Create a schema via the
.transformOrFail
function, then derive a generator from that schemarunning the generator potentially produces no values, despite the condition for successful creation being something simple like
strings longer than 5 characters
Potential solutions:
The text was updated successfully, but these errors were encountered: