From e36ccd304411b72547cf1737c54ff650021acc83 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Tue, 14 Mar 2023 13:43:37 +0100 Subject: [PATCH] dynamite: Fix enum parameters with default values --- packages/dynamite/lib/src/openapi_builder.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/lib/src/openapi_builder.dart index fe47e1b0..37e5b05a 100644 --- a/packages/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/lib/src/openapi_builder.dart @@ -604,7 +604,7 @@ class OpenAPIBuilder implements Builder { spec, state, _toDartName( - parameter.name, + '$operationId-${parameter.name}', uppercaseFirstCharacter: true, ), parameter.schema!, @@ -1078,6 +1078,9 @@ String _valueToEscapedValue(final TypeResult result, final dynamic value) { if (result is TypeResultList) { return 'const $value'; } + if (result is TypeResultEnum) { + return '${result.name}.${_toDartName(value.toString())}'; + } return value.toString(); }