Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dynamite_petstore_example): add linting #1341

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include: package:neon_lints/dart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,22 @@ class $Client extends DynamiteClient {
'Accept': 'application/json',
};

var $tags = jsonSerializers.serialize(tags, specifiedType: const FullType(BuiltList, [FullType(String)]));
final $tags = jsonSerializers.serialize(tags, specifiedType: const FullType(BuiltList, [FullType(String)]));
_parameters['tags'] = $tags;

var $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int));
final $limit = jsonSerializers.serialize(limit, specifiedType: const FullType(int));
_parameters['limit'] = $limit;

final _path = UriTemplate('/pets{?tags*,limit*}').expand(_parameters);
return DynamiteRawResponse<BuiltList<Pet>, void>(
response: this.executeRequest(
response: executeRequest(
'get',
_path,
_headers,
null,
const {200},
),
bodyType: FullType(BuiltList, [FullType(Pet)]),
bodyType: const FullType(BuiltList, [FullType(Pet)]),
headersType: null,
serializers: jsonSerializers,
);
Expand Down Expand Up @@ -162,14 +162,14 @@ class $Client extends DynamiteClient {
_body = utf8.encode(json.encode(jsonSerializers.serialize(newPet, specifiedType: const FullType(NewPet))));
const _path = '/pets';
return DynamiteRawResponse<Pet, void>(
response: this.executeRequest(
response: executeRequest(
'post',
_path,
_headers,
_body,
const {200},
),
bodyType: FullType(Pet),
bodyType: const FullType(Pet),
headersType: null,
serializers: jsonSerializers,
);
Expand Down Expand Up @@ -220,19 +220,19 @@ class $Client extends DynamiteClient {
'Accept': 'application/json',
};

var $id = jsonSerializers.serialize(id, specifiedType: const FullType(int));
final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int));
_parameters['id'] = $id;

final _path = UriTemplate('/pets/{id}').expand(_parameters);
return DynamiteRawResponse<Pet, void>(
response: this.executeRequest(
response: executeRequest(
'get',
_path,
_headers,
null,
const {200},
),
bodyType: FullType(Pet),
bodyType: const FullType(Pet),
headersType: null,
serializers: jsonSerializers,
);
Expand Down Expand Up @@ -281,12 +281,12 @@ class $Client extends DynamiteClient {
final _parameters = <String, dynamic>{};
final _headers = <String, String>{};

var $id = jsonSerializers.serialize(id, specifiedType: const FullType(int));
final $id = jsonSerializers.serialize(id, specifiedType: const FullType(int));
_parameters['id'] = $id;

final _path = UriTemplate('/pets/{id}').expand(_parameters);
return DynamiteRawResponse<void, void>(
response: this.executeRequest(
response: executeRequest(
'delete',
_path,
_headers,
Expand Down Expand Up @@ -377,13 +377,13 @@ abstract class Error implements $ErrorInterface, Built<Error, ErrorBuilder> {
// coverage:ignore-start
@visibleForTesting
final Serializers serializers = (Serializers().toBuilder()
..addBuilderFactory(FullType(BuiltList, [FullType(String)]), ListBuilder<String>.new)
..addBuilderFactory(FullType(Pet), PetBuilder.new)
..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder<String>.new)
..addBuilderFactory(const FullType(Pet), PetBuilder.new)
..add(Pet.serializer)
..addBuilderFactory(FullType(NewPet), NewPetBuilder.new)
..addBuilderFactory(const FullType(NewPet), NewPetBuilder.new)
..add(NewPet.serializer)
..addBuilderFactory(FullType(BuiltList, [FullType(Pet)]), ListBuilder<Pet>.new)
..addBuilderFactory(FullType(Error), ErrorBuilder.new)
..addBuilderFactory(const FullType(BuiltList, [FullType(Pet)]), ListBuilder<Pet>.new)
..addBuilderFactory(const FullType(Error), ErrorBuilder.new)
..add(Error.serializer))
.build();

Expand Down
6 changes: 6 additions & 0 deletions packages/dynamite/dynamite_petstore_example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ dependencies:
git:
url: https://github.com/nextcloud/neon
path: packages/dynamite/dynamite_runtime
meta: ^1.0.0
universal_io: ^2.0.0
uri: ^1.0.0

dev_dependencies:
Expand All @@ -22,3 +24,7 @@ dev_dependencies:
git:
url: https://github.com/nextcloud/neon
path: packages/dynamite/dynamite
neon_lints:
git:
url: https://github.com/nextcloud/neon
path: packages/neon_lints
Leptopoda marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# melos_managed_dependency_overrides: dynamite,dynamite_runtime
# melos_managed_dependency_overrides: dynamite,dynamite_runtime,neon_lints
dependency_overrides:
dynamite:
path: ../dynamite
dynamite_runtime:
path: ../dynamite_runtime
neon_lints:
path: ../../neon_lints