|
|
@ -4,21 +4,25 @@ class Spec { |
|
|
|
Spec({ |
|
|
|
Spec({ |
|
|
|
required this.version, |
|
|
|
required this.version, |
|
|
|
required this.info, |
|
|
|
required this.info, |
|
|
|
required this.tags, |
|
|
|
this.tags, |
|
|
|
required this.paths, |
|
|
|
this.paths, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toMap() => { |
|
|
|
Map<String, dynamic> toMap() => { |
|
|
|
'openapi': version, |
|
|
|
'openapi': version, |
|
|
|
'info': info.toMap(), |
|
|
|
'info': info.toMap(), |
|
|
|
'tags': tags.map((final tag) => <String, String>{'name': tag}).toList(), |
|
|
|
if (tags != null) ...{ |
|
|
|
'paths': paths.map((final key, final value) => MapEntry(key, value.toMap())), |
|
|
|
'tags': tags!.map((final tag) => <String, String>{'name': tag}).toList(), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
if (paths != null) ...{ |
|
|
|
|
|
|
|
'paths': paths!.map((final key, final value) => MapEntry(key, value.toMap())), |
|
|
|
|
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
final String version; |
|
|
|
final String version; |
|
|
|
final Info info; |
|
|
|
final Info info; |
|
|
|
final List<String> tags; |
|
|
|
final List<String>? tags; |
|
|
|
final Map<String, Path> paths; |
|
|
|
final Map<String, Path>? paths; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class Info { |
|
|
|
class Info { |
|
|
|