diff --git a/ydkgen/api_model.py b/ydkgen/api_model.py index d6b8e7a4f..f522ceb60 100644 --- a/ydkgen/api_model.py +++ b/ydkgen/api_model.py @@ -528,7 +528,7 @@ def get_key_props(self): for prop in [p for p in self.owned_elements if isinstance(p, Property)]: if prop.stmt in key_stmts: key_props.append(prop) - return sorted(key_props, key=lambda k: k.name) + return key_props def __eq__(self, other): if isinstance(other, self.__class__): @@ -851,7 +851,7 @@ def get_properties(owned_elements): # first get the key properties key_props = [p for p in all_props if p.is_key()] - props.extend(sorted(key_props, key=lambda p:p. name)) + props.extend(key_props) non_key_props = [p for p in all_props if not p.is_key()] props.extend(sorted(non_key_props, key=lambda p: p.name))