diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index 9763e6b0..0271d4ab 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -584,7 +584,7 @@ class OpenAPIBuilder implements Builder { b ..named = true ..name = _toDartName(parameter.name) - ..required = parameter.required ?? false; + ..required = (parameter.required ?? false) && defaultValueCode == null; if (parameter.schema != null) { b.type = refer( _makeNullable(