From 7d6bbc4e62e9fe5eb5e4c7d6e5c18c3802f54e1a Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Tue, 12 Dec 2023 17:15:53 +0100 Subject: [PATCH] fix(dynamite_end_to_end_test): do not use special characters in query parameter names. Signed-off-by: Nikolas Rimikis --- .../dynamite_end_to_end_test/lib/parameters.openapi.dart | 4 ++-- .../dynamite_end_to_end_test/lib/parameters.openapi.json | 4 ++-- .../dynamite_end_to_end_test/test/parameters_test.dart | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart index d919d747136..e7ff4151368 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.dart @@ -85,7 +85,7 @@ class Client extends DynamiteClient { Uint8List? body; if (contentString != null) { - queryParameters['content-string'] = jsonSerializers.serialize( + queryParameters['content_string'] = jsonSerializers.serialize( contentString, specifiedType: const FullType(ContentString, [ FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), @@ -93,7 +93,7 @@ class Client extends DynamiteClient { ); } if (contentParameter != null) { - queryParameters['content-parameter'] = jsonSerializers.serialize( + queryParameters['content_parameter'] = jsonSerializers.serialize( contentParameter, specifiedType: const FullType(ContentString, [ FullType(BuiltMap, [FullType(String), FullType(JsonObject)]), diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json index ecf3fd6713c..7bb32c281be 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json +++ b/packages/dynamite/dynamite_end_to_end_test/lib/parameters.openapi.json @@ -9,7 +9,7 @@ "get": { "parameters": [ { - "name": "content-string", + "name": "content_string", "in": "query", "schema": { "type": "string", @@ -21,7 +21,7 @@ } }, { - "name": "content-parameter", + "name": "content_parameter", "in": "query", "content": { "application/json": { diff --git a/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart b/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart index 8500e2cf72d..348513d1fa5 100644 --- a/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart +++ b/packages/dynamite/dynamite_end_to_end_test/test/parameters_test.dart @@ -66,7 +66,7 @@ void main() { captured, equals([ 'get', - Uri.parse('example.com/?content-string=$queryComponent'), + Uri.parse('example.com/?content_string=$queryComponent'), ]), ); }); @@ -84,7 +84,7 @@ void main() { captured, equals([ 'get', - Uri.parse('example.com/?content-parameter=$queryComponent'), + Uri.parse('example.com/?content_parameter=$queryComponent'), ]), ); }); @@ -102,7 +102,7 @@ void main() { captured, equals([ 'get', - Uri.parse('example.com/?content-string=$queryComponent&content-parameter=$queryComponent'), + Uri.parse('example.com/?content_string=$queryComponent&content_parameter=$queryComponent'), ]), ); });