Conversation
| } else { | ||
| xmlMetadata["text"] = true; | ||
| } | ||
| break; |
iscai-msft
left a comment
There was a problem hiding this comment.
thanks so much for your work @tadelesh
| if (type.kind === "property" && type.type.kind === "array" && type.type.valueType.kind !== "model") { | ||
| const itemMetadata = getXmlMetadata(type.type.valueType); | ||
| // if array item is a primitive type, we need to use itemsName to change the name | ||
| if (Object.keys(itemMetadata).length > 0) { |
There was a problem hiding this comment.
nit: should these just correspond 1-1 with what tsp is returning to us? I.e. xmlMetadata["name"] = itemMetadata["name"]
There was a problem hiding this comment.
tsp only returns the user defined decorator data. xml has some convention that i need to specific handle. so the item related metadata is only for ser/deser in python.
| for _, rf in self._attr_to_rest_field.items(): | ||
| prop_meta = getattr(rf, "_xml", {}) | ||
| xml_name = prop_meta.get("name", rf._rest_name) | ||
| xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) |
There was a problem hiding this comment.
i'm not familiar enough with all of this code, but I just want to make sure that we generate everything when we output our generated models. Like how right now we aren't always generating a deserializing callback, even though during generation time we know exactly what the deserializing callback should be. So we can generate xml stuff all the time, so we don't have to guess
There was a problem hiding this comment.
current logic for xml does not touch any deserialization mapping in __new__. so what you want is a common logic both for json and xml. i saw you opened this: #2801. i will work on the optimization after vacation.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
No description provided.