@autorest/python 5.12.3 → 5.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ChangeLog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Change Log
2
2
 
3
+ ### 2022-01-14 - 5.12.4
4
+
5
+ | Library | Min Version
6
+ | --------------- | -------
7
+ |`@autorest/core` | `3.6.2`
8
+ |`@autorest/modelerfour` | `4.19.1`
9
+ |`azure-core` dep of generated code | `1.20.1`
10
+ |`msrest` dep of generated code | `0.6.21`
11
+ |`azure-mgmt-core` dep of generated code (If generating mgmt plane code) | `1.3.0`
12
+
13
+ **Bug Fixes**
14
+
15
+ - Remove duplicate generation of properties in classes that inherit from multiple classes #1120
16
+
3
17
  ### 2022-01-13 - 5.12.3
4
18
 
5
19
  | Library | Min Version
@@ -52,12 +52,12 @@ class ModelBaseSerializer:
52
52
  @staticmethod
53
53
  def get_properties_to_initialize(model: ObjectSchema) -> List[Property]:
54
54
  if model.base_models:
55
- properties_to_initialize = []
56
- for uncast_base_model in model.base_models:
57
- base_model = cast(ObjectSchema, uncast_base_model)
58
- for prop in model.properties:
59
- if prop not in base_model.properties or prop.is_discriminator or prop.constant:
60
- properties_to_initialize.append(prop)
55
+ properties_to_initialize = list({
56
+ p.name: p
57
+ for bm in model.base_models
58
+ for p in model.properties
59
+ if p not in cast(ObjectSchema, bm).properties or p.is_discriminator or p.constant
60
+ }.values())
61
61
  else:
62
62
  properties_to_initialize = model.properties
63
63
  return properties_to_initialize
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autorest/python",
3
- "version": "5.12.3",
3
+ "version": "5.12.4",
4
4
  "description": "The Python extension for generators in AutoRest.",
5
5
  "scripts": {
6
6
  "prepare": "node run-python3.js prepare.py",