Browse Source

dynamite: Fix enum parameters with default values

pull/223/head
jld3103 2 years ago
parent
commit
e36ccd3044
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 5
      packages/dynamite/lib/src/openapi_builder.dart

5
packages/dynamite/lib/src/openapi_builder.dart

@ -604,7 +604,7 @@ class OpenAPIBuilder implements Builder {
spec, spec,
state, state,
_toDartName( _toDartName(
parameter.name, '$operationId-${parameter.name}',
uppercaseFirstCharacter: true, uppercaseFirstCharacter: true,
), ),
parameter.schema!, parameter.schema!,
@ -1078,6 +1078,9 @@ String _valueToEscapedValue(final TypeResult result, final dynamic value) {
if (result is TypeResultList) { if (result is TypeResultList) {
return 'const $value'; return 'const $value';
} }
if (result is TypeResultEnum) {
return '${result.name}.${_toDartName(value.toString())}';
}
return value.toString(); return value.toString();
} }

Loading…
Cancel
Save