dioxic / mgenerate4j

Json test data generation tool for MongoDB
https://dioxic.github.io/mgenerate4j/
Apache License 2.0
12 stars 1 forks source link

Using document placeholder raises class cast exception. #4

Open mashfaqu opened 3 years ago

mashfaqu commented 3 years ago

template1.json

{
  "firstName": "$first",
  "lastName": "$last",
  "fullName": "${firstName} ${lastName}"
}
Template template = from(getResourcePath("mgenerate/templates/template1.json"));
 BsonDocument bsonDocument = template.toBsonDocument();
class java.util.HashSet cannot be cast to class java.util.List (java.util.HashSet and java.util.List are in module java.base of loader 'bootstrap')

I am using mgenerate-core 0.0.7 with java 11

have I missed anything here?

dioxic commented 3 years ago

Hi @mashfaqu - did you resolve the issue? Apologies, I haven't had time to try and re-produce yet.

mashfaqu commented 3 years ago

@dioxic , unfortunately no. I am using this https://dioxic.github.io/mgenerate4j/placeholders/ document to reference the placeholders in the json.

{ "firstName": "$first", "lastName": "$last", "fullName": "${firstName} ${lastName}", "country": "$country" }

But this does not seem to work and raises a class cast exception that I pointed in my previous comment.