Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed handling of services with arrays inside them #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sprenger120
Copy link

This PR fixes two things that I've found not working at all.

  • First, a statically sized array, while being shown correctly in the UI, always contained zeroes when the service was called. This was due to missing handling of array slot_types which in turn required generation of the correct expression names.
  • Second, filling in a dynamically sized array was not possible (afaik), and always resulted in exceptions thrown in the serialization process due to Python's dicts not supporting access by dot (.), by default.

I've added a small class called Map, which implements access by dot. This class was not written by be, but rather taken from the supplied stackoverflow link, tell me, if that would be a licensing problem.

To easily test my changes, I've written up a small test application which provides a service with arrays and outputs its content upon being called. See --> here

Potential problem
A dynamically sized array would be written, for the UI, like this [{'data1': 1, 'data2': 2}, {'data1': 5, 'data2': 6}]. If you forget to specify one dict key, present in the message definition, you get the previously mentioned serialization exception again. There needs to be some sort of default initialization of all message members in the dict, but I'm unsure how do it.

Added ability to specify dynamically sized arrays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant