Issue Setting JsonNullable
Field with Instancio Generator
#1209
Unanswered
RuslanNyko
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Hi @RuslanNyko, You can achieve this using a Scope jsonNullableScope = Select.scope(Pojo::getString);
Pojo pojo = Instancio.of(Pojo.class)
.generate(Select.allStrings().within(jsonNullableScope), g -> g.oneOf("S", "P", "O"))
.create(); You could also use Please see these links for more details: |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I’m encountering an issue while using Instancio to generate instances of a class that contains a
JsonNullable
field. Below is my setup:Pojo Class:
Instancio Generator Code:
Exception Thrown:
Question:
How can I correctly use Instancio to generate and set values for a
JsonNullable<String>
field? Is it possible to utilizeInstancioServiceProvider
for this purpose, or is there another recommended approach?Any guidance or examples on handling
JsonNullable
withInstancio
would be greatly appreciated!Beta Was this translation helpful? Give feedback.
All reactions