diff --git a/sbe/__init__.py b/sbe/__init__.py index fbb865d..27779a3 100644 --- a/sbe/__init__.py +++ b/sbe/__init__.py @@ -1054,7 +1054,7 @@ def _parse_schema(f: TextIO) -> Schema: elif action == "end": x = stack.pop() assert isinstance(stack[-1], Schema) - x.choices = sorted(x.choices, key=lambda y: int(y.value)) + x.choices = sorted(x.choices, key=lambda y: int(y.value), reverse=True) stack[-1].types[x.name] = x elif tag == "choice":