-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dynamite): document generated libraries and add support for all …
…info fields Signed-off-by: Nikolas Rimikis <[email protected]>
- Loading branch information
Showing
58 changed files
with
1,602 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 16 additions & 1 deletion
17
packages/dynamite/dynamite/example/lib/petstore.openapi.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
// Use of this source code is governed by a Apache 2.0 license. It can be obtained at `https://www.apache.org/licenses/LICENSE-2.0.html`. | ||
|
||
// OpenAPI client generated by Dynamite. Do not manually edit this file. | ||
|
||
// ignore_for_file: camel_case_types, discarded_futures | ||
// ignore_for_file: no_leading_underscores_for_local_identifiers | ||
// ignore_for_file: public_member_api_docs, unreachable_switch_case | ||
|
||
// ignore_for_file: no_leading_underscores_for_library_prefixes | ||
/// Swagger Petstore Version: 1.0.0. | ||
/// | ||
/// A sample API that uses a petstore as an example to demonstrate features in the OpenAPI 3.0 specification. | ||
/// | ||
/// You can contact the Swagger API Team team under: | ||
/// Email: `[email protected]`. | ||
/// Website: `http://swagger.io`. | ||
/// | ||
/// Use of this source code is governed by a Apache 2.0 license. | ||
/// It can be obtained at `https://www.apache.org/licenses/LICENSE-2.0.html`. | ||
/// | ||
/// Usage of these apis must adhere to the terms of service: `http://swagger.io/terms/`. | ||
library; // ignore_for_file: no_leading_underscores_for_library_prefixes | ||
|
||
import 'dart:convert'; | ||
import 'dart:typed_data'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
packages/dynamite/dynamite/lib/src/models/openapi/contact.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import 'package:built_value/built_value.dart'; | ||
import 'package:built_value/serializer.dart'; | ||
|
||
part 'contact.g.dart'; | ||
|
||
abstract class Contact implements Built<Contact, ContactBuilder> { | ||
factory Contact([void Function(ContactBuilder) updates]) = _$Contact; | ||
|
||
const Contact._(); | ||
|
||
static Serializer<Contact> get serializer => _$contactSerializer; | ||
|
||
String? get name; | ||
String? get url; | ||
String? get email; | ||
|
||
String? formattedDescription() { | ||
final name = this.name; | ||
final url = this.url; | ||
final email = this.email; | ||
|
||
if (name == null || (url ?? email) == null) { | ||
return null; | ||
} | ||
|
||
final buffer = StringBuffer('You can contact the $name team under:'); | ||
if (email != null) { | ||
buffer | ||
..write('\n') | ||
..write(' Email: `$email`'); | ||
} | ||
if (url != null) { | ||
buffer | ||
..write('\n') | ||
..write(' Website: `$url`'); | ||
} | ||
|
||
return buffer.toString(); | ||
} | ||
} |
163 changes: 163 additions & 0 deletions
163
packages/dynamite/dynamite/lib/src/models/openapi/contact.g.dart
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.