Skip to content

Commit

Permalink
support encoding of optional parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpoul committed May 14, 2024
1 parent 77eeebc commit 2d24334
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
6 changes: 3 additions & 3 deletions packages/openapi_base/lib/src/openapi_client_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ mixin OpenApiUrlEncodeMixin {
List<String> encodeString(String? value) => value == null ? [] : [value];

@protected
List<String> encodeNum(num value) => encodeObject(value);
List<String> encodeNum(num? value) => encodeObject(value);

@protected
List<String> encodeInt(int value) => encodeObject(value);
List<String> encodeInt(int? value) => encodeObject(value);

@protected
List<String> encodeBool(bool value) => encodeObject(value);
List<String> encodeBool(bool? value) => encodeObject(value);

List<String> encodeObject(Object? value) =>
value == null ? [] : [value.toString()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ TypeReference _referType(
..symbol = name
..url = url
..isNullable = isNullable
..types.addAll(generics!));
..types.addAll(generics ?? []));

extension on Reference {
Reference addGenerics(Reference type) {
Expand Down
28 changes: 17 additions & 11 deletions packages/openapi_code_builder/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,17 @@ packages:
open_api_forked:
dependency: "direct main"
description:
name: open_api_forked
sha256: e815a0adbb290b6b460c48808de2b393f95522b1016cdb5d54cc8098cc8d5d2f
url: "https://pub.dev"
source: hosted
path: "../../deps/open-api-dart"
relative: true
source: path
version: "3.0.0+6"
openapi_base:
dependency: "direct main"
description:
name: openapi_base
sha256: "99c7f3bb935e1bfd863fcbecfcd28af6a9e5937bbd5f083de4b71b3aab6a3ddf"
url: "https://pub.dev"
source: hosted
version: "1.1.0+3"
path: "../openapi_base"
relative: true
source: path
version: "1.3.1"
package_config:
dependency: transitive
description:
Expand Down Expand Up @@ -313,6 +311,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.10.0"
sprintf:
dependency: transitive
description:
name: sprintf
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -373,10 +379,10 @@ packages:
dependency: transitive
description:
name: uuid
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313"
sha256: "814e9e88f21a176ae1359149021870e87f7cddaf633ab678a5d2b0bff7fd1ba8"
url: "https://pub.dev"
source: hosted
version: "3.0.7"
version: "4.4.0"
watcher:
dependency: transitive
description:
Expand Down
5 changes: 0 additions & 5 deletions packages/openapi_code_builder/pubspec_overrides.yaml.old

This file was deleted.

0 comments on commit 2d24334

Please sign in to comment.