remondis-it / pact-consumer-builder

Library for generating pact consumer expectations from java beans
Apache License 2.0
14 stars 6 forks source link

Readme at Top-level collections #31

Open hansjoergkeser opened 3 years ago

hansjoergkeser commented 3 years ago

Hi there,

I'm trying your builder and ran into NPE using the PactDslJsonArray generator according to your readme. Without .arrayContent() it fails with nullpointer eception in the build step, because the arrayContentBuilder variable has no default value.

Wanted to open a pull request, but have no permission. Here my proposal to update the readme:

PactDslJsonArray pactDslJsonArray = ConsumerExpects.collectionOf(<LIST_ITEM_ELEMENT_TYPE>.class)
   .arrayContent(ConsumerExpects.type(<LIST_ITEM_ELEMENT_TYPE>.class))
   .useArraySupplier(supplier) // Optional: Use a custom array structure supplier
   .build(<LIST_ITEM_SAMPLE_HERE>);
schuettec commented 3 years ago

Hi thanks for your suggestion. I will have a look in a few days :)

Greetings!

Hajo notifications@github.com schrieb am Do., 24. Dez. 2020, 15:56:

Hi there,

I'm trying your builder and ran into NPE using the PactDslJsonArray generator according to your readme. Without .arrayContent() it fails with nullpointer eception in the build step, because the arrayContentBuilder variable has no default value.

Wanted to open a pull request, but have no permission. Here my proposal to update the readme:

PactDslJsonArray pactDslJsonArray = ConsumerExpects.collectionOf(.class) .arrayContent(ConsumerExpects.type(.class)) .useArraySupplier(supplier) // Optional: Use a custom array structure supplier .build();

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/remondis-it/pact-consumer-builder/issues/31, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADNFVQXQPMV7ELSDAUUCUNDSWNJDXANCNFSM4VIIZ4JQ .