Skip to content

Commit

Permalink
Merge pull request #1286 from nextcloud/fix/dynamite-e2e/fix-spec-que…
Browse files Browse the repository at this point in the history
…ry-parameter-escaping

fix(dynamite_end_to_end_test): do not use special characters in query…
  • Loading branch information
Leptopoda authored Dec 13, 2023
2 parents c54bce9 + 7d6bbc4 commit 099a3b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ 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)]),
]),
);
}
if (contentParameter != null) {
queryParameters['content-parameter'] = jsonSerializers.serialize(
queryParameters['content_parameter'] = jsonSerializers.serialize(
contentParameter,
specifiedType: const FullType(ContentString, [
FullType(BuiltMap, [FullType(String), FullType(JsonObject)]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"get": {
"parameters": [
{
"name": "content-string",
"name": "content_string",
"in": "query",
"schema": {
"type": "string",
Expand All @@ -21,7 +21,7 @@
}
},
{
"name": "content-parameter",
"name": "content_parameter",
"in": "query",
"content": {
"application/json": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void main() {
captured,
equals([
'get',
Uri.parse('example.com/?content-string=$queryComponent'),
Uri.parse('example.com/?content_string=$queryComponent'),
]),
);
});
Expand All @@ -84,7 +84,7 @@ void main() {
captured,
equals([
'get',
Uri.parse('example.com/?content-parameter=$queryComponent'),
Uri.parse('example.com/?content_parameter=$queryComponent'),
]),
);
});
Expand All @@ -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'),
]),
);
});
Expand Down

0 comments on commit 099a3b8

Please sign in to comment.