add(conduit): working on refactoring open_api to openapi

This commit is contained in:
Patrick Stewart 2024-08-04 03:59:05 -07:00
parent f9c443fbc6
commit 14149a3e3c
34 changed files with 311 additions and 14 deletions

View 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.
*/

View 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();
}

View 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;
}

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View 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.
*/

View file

@ -1,7 +1,10 @@
/// Support for doing something awesome.
///
/// More dartdocs go here.
/*
* 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.
*/
library;
// TODO: Export any libraries intended for clients of this package.

View file

@ -1,7 +1,10 @@
/// Support for doing something awesome.
///
/// More dartdocs go here.
/*
* 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.
*/
library;
// TODO: Export any libraries intended for clients of this package.

View file

@ -1,5 +1,5 @@
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
homepage: https://protevus.com
documentation: https://docs.protevus.com
@ -10,7 +10,8 @@ environment:
# Add regular dependencies here.
dependencies:
# path: ^1.8.0
protevus_typeforge: ^0.0.1
meta: ^1.12.0
dev_dependencies:
lints: ^3.0.0