-
Notifications
You must be signed in to change notification settings - Fork 31
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
Wrong serializer used if array of string uses enum #1276
Comments
Hi @fredmaggiowski, |
Hi, thanks for your reply! I've tried looking into it yesterday but didn't manage to find enough time to properly study the repo and create a valid test case to replicate the issue in a test 😞 |
Thanks for looking into it. Do you have any specific question that could help bootstrap your work? |
Hi, I haven't got much time to work this last week; I've briefly read the tests of the class you linked me but couldn't figure out the proper way to fit my use case in them. I've planned to work on this by the end of the week. |
@fredmaggiowski @baywet |
Hi @rners01, unfortunately I couldn't find some time to put on the issue yet :( |
@rners01 do you want to try submitting a pull request for this? |
Hey @baywet, okay, can you give some tips? |
You can add unit tests here (duplicate the existing, tweak the setup, tweak the assertions) Let us know if you have any additional comments or questions. |
Hey @baywet , debug example with existing |
Hi @rners01 |
@baywet created |
Is there a workaround or update on the PR for this? Being able to serialize an array of enums seems like a pretty crucial feature for this type of library.. |
Hello, we are facing a problem with an API that holds an array of strings which has specific allowed values defined by enum.
Such array is being transformed to a comma separated list rather than having a proper JSON serialization.
Portion of the JSON Schema we are using
This JSON schema is correctly interpreted by Swagger UI
However when serializing the payload we get this result:
I've reproduced this issue in a test I have in my project where I'm intercepting the request produced by the generated client:
After doing a bit of reverse engineering I've found this line that may be the culprint
As far as I understood, here the
contexts
field is being registered as an enum rather than an CollectionOfObjects and I think may be the cause of the serialization issue.By updating the OAS definition not to use the enum there is a visible change to the above row: https://github.com/mia-platform/console-sdk/pull/186/files#diff-edaa8455836441c91748a0db0ddb0ae4d819148908dd0da2de5b92c60de36d5aR378
see mia-platform/console-sdk#186
Does this make sense, do you have any insights of something I may overlook?
Thanks
The text was updated successfully, but these errors were encountered: