Closed lmazuel closed 7 years ago
Tested by @vishrutshah on his Monitor issue and all SDK tests ok.
@annatisch I dig inside the msrest code and I realize I re-wrote _classify
but calling it _infer_type
. I will rework on this to simplify code and avoid duplication.
@lmazuel - yes I thought there might be some duplication there - I was about to compare them myself :)
@annatisch if you have the time, I pushed an update that should still fix the serialization + the deserialisation at the time (rewriting classify to include both fix). I didn't launch Autorest tests or SDKs yet.
@annatisch I think everything is here and fix all these issues:
Thoughts?
@lmazuel - yup looks like it! :) Yay!
@annatisch last commit was debugged directly with @vishrutshah in peer programming. This allows to accept as key in the dict (serialisation) both the JSON key name and the Python key name. Let's say RestAPI uses "awesomeName", so Python will use "awesome_name". Now for subtyping, both syntax are correct in a dict. This allows to figure out subtyping even from a dict (serialisation) and from a JSON (deserialisation) even if the key are not expected to be the same. Also, it's been a long time I think about accepting both keys syntax in dict serialization (to simplify a copy/paste from a RestAPI example), so I'm shocked and don't consider this a hack. Unittest to be added before merging this PR.
Didn't test with Autorest testsuite yet, but since this is JSON-like syntax, I'm pretty sure there is no test in Autorest anyway.