We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4cc559e commit bd9f9d1Copy full SHA for bd9f9d1
1 file changed
src/opengeodeweb_microservice/schemas.py
@@ -0,0 +1,15 @@
1
+import os
2
+import glob
3
+import json
4
+
5
+type SchemaDict = dict[str, str]
6
7
8
+def get_schemas_dict(path: str) -> dict[str, SchemaDict]:
9
+ schemas_dict: dict[str, SchemaDict] = {}
10
+ for json_file in glob.glob(os.path.join(path, "*.json")):
11
+ filename = os.path.basename(json_file)
12
+ with open(os.path.join(path, json_file), "r") as file:
13
+ file_content = json.load(file)
14
+ schemas_dict[os.path.splitext(filename)[0]] = file_content
15
+ return schemas_dict
0 commit comments