Open shan-96 opened 4 years ago
I think there's still some confusion of kwargs in general, because RF own documentation states (implicitly) that single map can't be treated as kwarg from caller side
If a Java keyword accepts kwargs, Robot Framework will automatically pack all arguments in name=value syntax at the end of the keyword call into a Map and pass it to the keyword
According your use case you just want to use argument as type of map, not kwargs.
I think there's still some confusion of kwargs in general, because RF own documentation states (implicitly) that single map can't be treated as kwarg from caller side
If a Java keyword accepts kwargs, Robot Framework will automatically pack all arguments in name=value syntax at the end of the keyword call into a Map and pass it to the keyword
According your use case you just want to use argument as type of map, not kwargs.
Correct! I want to use the Map as normal arg but somehow it doesnt get parsed!
OK, I think now I started to see the issue. Not sure if I have time to check it within this week, but I'll try. Probably it requires new version from both JavalibCore and jrobotremoteserver, but let see.
Ok. If you need, you can go through my PR I will be adding few more test cases in it
Just remembered this, and noticed that there's a test that should check for that (https://github.com/robotframework/JavalibCore/blob/c649b8d629fc2afbc7da00b39bffdc3ced6a8754/src/test/java/org/robotframework/javalib/library/AnnotationLibraryIntegrationTest.java#L127).
So I'm still a bit puzzled of the issue.
Note that this needs annotations to work. With Classpathlibrary approach map is always varargs, and I don't think there's any reason to try to make any logic to try to determine if user wants to use arg or varargs.
Coming from https://github.com/robotframework/JavalibCore/issues/19 and robotframework documentation as java has no support for explicit kwarg variable, a single map passed on to robot keyword without
**
must also be considered as kwarg.In
KeywordInvoker.java
andArgumentCollector.java
while collecting argumentsargs
is not null with one non empty map butkwargs
are null. But after keyword argument collection we receive one empty map which is wrong