add(conduit): working on refactoring open_api to openapi
This commit is contained in:
parent
f9c443fbc6
commit
14149a3e3c
34 changed files with 311 additions and 14 deletions
8
packages/openapi/lib/src/object.dart
Normal file
8
packages/openapi/lib/src/object.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
28
packages/openapi/lib/src/util/list_helper.dart
Normal file
28
packages/openapi/lib/src/util/list_helper.dart
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// Removes null entries from a list of nullable strings and returns a new list of non-nullable strings.
|
||||||
|
///
|
||||||
|
/// This function takes a nullable list of nullable strings as input and performs two operations:
|
||||||
|
/// 1. It removes any null entries from the list.
|
||||||
|
/// 2. It converts the resulting list to a List<String>.
|
||||||
|
///
|
||||||
|
/// If the input list is null, the function returns null.
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
/// [list] - The input list of nullable strings (List<String?>?) that may contain null entries.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// A new List<String> with all non-null entries from the input list, or null if the input list is null.
|
||||||
|
List<String>? removeNullsFromList(List<String?>? list) {
|
||||||
|
if (list == null) return null;
|
||||||
|
|
||||||
|
// remove nulls and convert to List<String>
|
||||||
|
return list.nonNulls.toList();
|
||||||
|
}
|
38
packages/openapi/lib/src/util/map_helper.dart
Normal file
38
packages/openapi/lib/src/util/map_helper.dart
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/// Removes null values from a map and converts its type.
|
||||||
|
///
|
||||||
|
/// This function takes a nullable [Map] with potentially nullable values
|
||||||
|
/// and returns a new [Map] with the following characteristics:
|
||||||
|
/// - All entries with null values are removed.
|
||||||
|
/// - The resulting map is non-nullable (both for the map itself and its values).
|
||||||
|
/// - If the input map is null, an empty map is returned.
|
||||||
|
///
|
||||||
|
/// Parameters:
|
||||||
|
/// [map]: The input map of type `Map<K, V?>?` where `K` is the key type
|
||||||
|
/// and `V` is the value type.
|
||||||
|
///
|
||||||
|
/// Returns:
|
||||||
|
/// A new `Map<K, V>` with null values removed and non-nullable types.
|
||||||
|
Map<K, V> removeNullsFromMap<K, V>(Map<K, V?>? map) {
|
||||||
|
if (map == null) return <K, V>{};
|
||||||
|
|
||||||
|
final fixed = <K, V>{};
|
||||||
|
|
||||||
|
// remove nulls
|
||||||
|
for (final key in map.keys) {
|
||||||
|
final value = map[key];
|
||||||
|
if (value != null) {
|
||||||
|
fixed[key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fixed;
|
||||||
|
}
|
8
packages/openapi/lib/src/v2/document.dart
Normal file
8
packages/openapi/lib/src/v2/document.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/header.dart
Normal file
8
packages/openapi/lib/src/v2/header.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/metadata.dart
Normal file
8
packages/openapi/lib/src/v2/metadata.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/operation.dart
Normal file
8
packages/openapi/lib/src/v2/operation.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/parameter.dart
Normal file
8
packages/openapi/lib/src/v2/parameter.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/path.dart
Normal file
8
packages/openapi/lib/src/v2/path.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/property.dart
Normal file
8
packages/openapi/lib/src/v2/property.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/response.dart
Normal file
8
packages/openapi/lib/src/v2/response.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/schema.dart
Normal file
8
packages/openapi/lib/src/v2/schema.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/security.dart
Normal file
8
packages/openapi/lib/src/v2/security.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v2/types.dart
Normal file
8
packages/openapi/lib/src/v2/types.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/callback.dart
Normal file
8
packages/openapi/lib/src/v3/callback.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/componenets.dart
Normal file
8
packages/openapi/lib/src/v3/componenets.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/document.dart
Normal file
8
packages/openapi/lib/src/v3/document.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/encoding.dart
Normal file
8
packages/openapi/lib/src/v3/encoding.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/header.dart
Normal file
8
packages/openapi/lib/src/v3/header.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/media_type.dart
Normal file
8
packages/openapi/lib/src/v3/media_type.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/metadata.dart
Normal file
8
packages/openapi/lib/src/v3/metadata.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/operation.dart
Normal file
8
packages/openapi/lib/src/v3/operation.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/parameter.dart
Normal file
8
packages/openapi/lib/src/v3/parameter.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/path.dart
Normal file
8
packages/openapi/lib/src/v3/path.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/request_body.dart
Normal file
8
packages/openapi/lib/src/v3/request_body.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/response.dart
Normal file
8
packages/openapi/lib/src/v3/response.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/schema.dart
Normal file
8
packages/openapi/lib/src/v3/schema.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/security.dart
Normal file
8
packages/openapi/lib/src/v3/security.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/server.dart
Normal file
8
packages/openapi/lib/src/v3/server.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
8
packages/openapi/lib/src/v3/types.dart
Normal file
8
packages/openapi/lib/src/v3/types.dart
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
/*
|
||||||
|
* This file is part of the Protevus Platform.
|
||||||
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
|
@ -1,7 +1,10 @@
|
||||||
/// Support for doing something awesome.
|
/*
|
||||||
///
|
* This file is part of the Protevus Platform.
|
||||||
/// More dartdocs go here.
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
library;
|
library;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Export any libraries intended for clients of this package.
|
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
/// Support for doing something awesome.
|
/*
|
||||||
///
|
* This file is part of the Protevus Platform.
|
||||||
/// More dartdocs go here.
|
*
|
||||||
|
* (C) Protevus <developers@protevus.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
library;
|
library;
|
||||||
|
|
||||||
|
|
||||||
// TODO: Export any libraries intended for clients of this package.
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: protevus_openapi
|
name: protevus_openapi
|
||||||
description: The openapi specification for the Protevus Platform
|
description: Data structures for OpenAPI (Swagger) specification. Reads and writes JSON specifications.
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
homepage: https://protevus.com
|
homepage: https://protevus.com
|
||||||
documentation: https://docs.protevus.com
|
documentation: https://docs.protevus.com
|
||||||
|
@ -10,7 +10,8 @@ environment:
|
||||||
|
|
||||||
# Add regular dependencies here.
|
# Add regular dependencies here.
|
||||||
dependencies:
|
dependencies:
|
||||||
# path: ^1.8.0
|
protevus_typeforge: ^0.0.1
|
||||||
|
meta: ^1.12.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
lints: ^3.0.0
|
lints: ^3.0.0
|
||||||
|
|
Loading…
Reference in a new issue