refactor!: migrate class-validator to zod (#26597)

This commit is contained in:
Timon
2026-04-14 23:39:03 +02:00
committed by GitHub
parent 3753b7a4d1
commit 7d8f843be6
318 changed files with 7830 additions and 8316 deletions
+10 -10
View File
@@ -13,17 +13,17 @@ part of openapi.api;
class CreateLibraryDto {
/// Returns a new [CreateLibraryDto] instance.
CreateLibraryDto({
this.exclusionPatterns = const {},
this.importPaths = const {},
this.exclusionPatterns = const [],
this.importPaths = const [],
this.name,
required this.ownerId,
});
/// Exclusion patterns (max 128)
Set<String> exclusionPatterns;
List<String> exclusionPatterns;
/// Import paths (max 128)
Set<String> importPaths;
List<String> importPaths;
/// Library name
///
@@ -57,8 +57,8 @@ class CreateLibraryDto {
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'exclusionPatterns'] = this.exclusionPatterns.toList(growable: false);
json[r'importPaths'] = this.importPaths.toList(growable: false);
json[r'exclusionPatterns'] = this.exclusionPatterns;
json[r'importPaths'] = this.importPaths;
if (this.name != null) {
json[r'name'] = this.name;
} else {
@@ -78,11 +78,11 @@ class CreateLibraryDto {
return CreateLibraryDto(
exclusionPatterns: json[r'exclusionPatterns'] is Iterable
? (json[r'exclusionPatterns'] as Iterable).cast<String>().toSet()
: const {},
? (json[r'exclusionPatterns'] as Iterable).cast<String>().toList(growable: false)
: const [],
importPaths: json[r'importPaths'] is Iterable
? (json[r'importPaths'] as Iterable).cast<String>().toSet()
: const {},
? (json[r'importPaths'] as Iterable).cast<String>().toList(growable: false)
: const [],
name: mapValueOfType<String>(json, r'name'),
ownerId: mapValueOfType<String>(json, r'ownerId')!,
);