From 16b5e5b7ff770355217e804030540f0d5c6178b7 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 11 Jan 2023 10:46:38 +0100 Subject: [PATCH] dynamite: Fix required parameters with default value --- packages/dynamite/lib/src/openapi_builder.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(