diff --git a/autorest/codegen/models/parameter_list.py b/autorest/codegen/models/parameter_list.py
index 5f1c8b94f..500a776b3 100644
--- a/autorest/codegen/models/parameter_list.py
+++ b/autorest/codegen/models/parameter_list.py
@@ -115,16 +115,17 @@ class ParameterList(MutableSequence):
                 or parameter.is_kwarg
             )
 
-        signature_parameters_required = []
-        signature_parameters_optional = []
+
+        signature_parameters_no_default_value = []
+        signature_parameters_default_value = []
         for parameter in self.parameters:
             if is_parameter_in_signature(parameter):
-                if parameter.required:
-                    signature_parameters_required.append(parameter)
+                if not parameter.client_default_value and parameter.required:
+                    signature_parameters_no_default_value.append(parameter)
                 else:
-                    signature_parameters_optional.append(parameter)
+                    signature_parameters_default_value.append(parameter)
 
-        signature_parameters = signature_parameters_required + signature_parameters_optional
+        signature_parameters = signature_parameters_no_default_value + signature_parameters_default_value
         return signature_parameters
 
     @property

argument order syntax error 

Using

>  AutoRest code generation utility [cli version: 3.0.6187; node: v10.13.0, max-memory: 8192 gb]

With: Autorest for Python v5.0.0 - 20200228.1

And Swagger:

https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/search/data-plane/Microsoft.Azure.Search.Data/stable/2019-05-06/searchindex.json

generates this output:

```
def __init__(
        self,
        search_service_name,  # type: str
        search_dns_suffix="search.windows.net",  # type: str
        index_name,  # type: str
        **kwargs  # type: Any
    ):
```
Which is

> SyntaxError: non-default argument follows default argument
diff --git a/test/unittests/test_parameter_ordering.py b/test/unittests/test_parameter_ordering.py
new file mode 100644
index 000000000..ce4e06df7
--- /dev/null
+++ b/test/unittests/test_parameter_ordering.py
@@ -0,0 +1,59 @@
+import pytest
+from autorest.codegen.models import Parameter, AnySchema
+from autorest.codegen.models.parameter_list import ParameterList
+from autorest.codegen.models.parameter import ParameterLocation
+
+def get_parameter(name, required, default_value=None):
+    schema = AnySchema(
+        namespace="parameterordering",
+        yaml_data={}
+    )
+    return Parameter(
+        schema=schema,
+        yaml_data={},
+        rest_api_name=name,
+        serialized_name=name,
+        description="Parameter to test parameter ordering",
+        implementation="Method",
+        required=required,
+        location=ParameterLocation.Path,
+        skip_url_encoding=True,
+        constraints=[],
+        client_default_value=default_value
+    )
+
+def test_sort_required_parameters():
+    required_default_value_parameter = get_parameter(
+        name="required_default_value_parameter",
+        required=True,
+        default_value="hello"
+    )
+    required_parameter = get_parameter(
+        name="required_parameter",
+        required=True
+    )
+
+    parameter_list = [required_parameter, required_default_value_parameter]
+
+    assert [required_parameter, required_default_value_parameter] == ParameterList(parameter_list).method
+
+    # switch around ordering to confirm
+
+    parameter_list = [required_default_value_parameter, required_parameter]
+
+    assert [required_parameter, required_default_value_parameter] == ParameterList(parameter_list).method
+
+def test_sort_required_and_non_required_parameters():
+    required_parameter = get_parameter(
+        name="required_parameter",
+        required=True
+    )
+
+    optional_parameter = get_parameter(
+        name="optional_parameter",
+        required=False
+    )
+
+    parameter_list = [optional_parameter, required_parameter]
+
+    assert [required_parameter, optional_parameter] == ParameterList(parameter_list).method
\ No newline at end of file

pip install -e .[dev]
parse_log_pytest
requirements.txt
3.7
dev_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
astroid==2.3.3
-e git+https://github.com/Azure/autorest.python.git@4793bd7b9ddc25a241cd54538b4c5750f915b3d2#egg=autorest
black==23.3.0
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
chardet==5.2.0
click==8.1.8
colorama==0.4.6
distlib==0.3.9
docutils==0.20.1
exceptiongroup==1.2.2
filelock==3.12.2
importlib-metadata==6.7.0
iniconfig==2.0.0
invoke==2.2.0
isort==4.3.21
Jinja2==3.1.6
json-rpc==1.15.0
lazy-object-proxy==1.4.3
m2r==0.3.1
MarkupSafe==2.1.5
mccabe==0.6.1
mistune==0.8.4
mypy==1.4.1
mypy-extensions==1.0.0
packaging==24.0
pathspec==0.11.2
platformdirs==4.0.0
pluggy==1.2.0
ptvsd==4.3.2
pylint==2.4.4
pyproject-api==1.5.3
pytest==7.4.4
PyYAML==6.0.1
six==1.17.0
tomli==2.0.1
tox==4.8.0
typed-ast==1.4.3
typing_extensions==4.7.1
virtualenv==20.26.6
wrapt==1.11.2
zipp==3.15.0

name: autorest.python
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - astroid==2.3.3
      - black==23.3.0
      - cachetools==5.5.2
      - chardet==5.2.0
      - click==8.1.8
      - colorama==0.4.6
      - distlib==0.3.9
      - docutils==0.20.1
      - exceptiongroup==1.2.2
      - filelock==3.12.2
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - invoke==2.2.0
      - isort==4.3.21
      - jinja2==3.1.6
      - json-rpc==1.15.0
      - lazy-object-proxy==1.4.3
      - m2r==0.3.1
      - markupsafe==2.1.5
      - mccabe==0.6.1
      - mistune==0.8.4
      - mypy==1.4.1
      - mypy-extensions==1.0.0
      - packaging==24.0
      - pathspec==0.11.2
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - ptvsd==4.3.2
      - pylint==2.4.4
      - pyproject-api==1.5.3
      - pytest==7.4.4
      - pyyaml==6.0.1
      - six==1.17.0
      - tomli==2.0.1
      - tox==4.8.0
      - typed-ast==1.4.3
      - typing-extensions==4.7.1
      - virtualenv==20.26.6
      - wrapt==1.11.2
      - zipp==3.15.0
prefix: /opt/conda/envs/autorest.python

test/unittests/test_parameter_ordering.py::test_sort_required_parameters
test/unittests/test_parameter_ordering.py::test_sort_required_and_non_required_parameters
autorest/codegen/models/parameter_list.py
autorest/codegen/models/parameter_list.py