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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I’m encountering an issue while using Instancio to generate instances of a class that contains a
JsonNullablefield. 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 utilizeInstancioServiceProviderfor this purpose, or is there another recommended approach?Any guidance or examples on handling
JsonNullablewithInstanciowould be greatly appreciated!Beta Was this translation helpful? Give feedback.
All reactions