Skip to content

Commit 0243dbc

Browse files
Merge pull request #71 from Geode-solutions/refactor/key
refactor(key): switch to filter_key
2 parents 913eb34 + b78fc6c commit 0243dbc

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
)
2929
def allowed_files():
3030
geode_functions.validate_request(flask.request, allowed_files_json)
31-
extensions = geode_functions.list_input_extensions(flask.request.json["key"])
31+
extensions = geode_functions.list_input_extensions(
32+
flask.request.json["supported_feature"]
33+
)
3234
return {"status": 200, "extensions": extensions}
3335

3436

@@ -75,7 +77,7 @@ def allowed_objects():
7577
geode_functions.validate_request(flask.request, allowed_objects_json)
7678
file_absolute_path = os.path.join(UPLOAD_FOLDER, flask.request.json["filename"])
7779
allowed_objects = geode_functions.list_geode_objects(
78-
file_absolute_path, flask.request.json["key"]
80+
file_absolute_path, flask.request.json["supported_feature"]
7981
)
8082
return flask.make_response({"allowed_objects": allowed_objects}, 200)
8183

src/opengeodeweb_back/routes/schemas/allowed_files.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"methods": ["POST"],
44
"type": "object",
55
"properties": {
6-
"key": {
6+
"supported_feature": {
77
"type": ["string", "null"]
88
}
99
},
10-
"required": ["key"],
10+
"required": ["supported_feature"],
1111
"additionalProperties": false
1212
}

src/opengeodeweb_back/routes/schemas/allowed_objects.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"filename": {
77
"type": "string"
88
},
9-
"key": {
9+
"supported_feature": {
1010
"type": ["string", "null"]
1111
}
1212
},
13-
"required": ["filename", "key"],
13+
"required": ["filename", "supported_feature"],
1414
"additionalProperties": false
1515
}

tests/test_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
def test_allowed_files(client):
77
route = f"/allowed_files"
8-
response = client.post(route, json={"key": None})
8+
response = client.post(route, json={"supported_feature": None})
99
assert response.status_code == 200
1010
extensions = response.json["extensions"]
1111
assert type(extensions) is list
@@ -19,7 +19,7 @@ def test_allowed_objects(client):
1919
def get_full_data():
2020
return {
2121
"filename": "corbi.og_brep",
22-
"key": None,
22+
"supported_feature": None,
2323
}
2424

2525
# Normal test with filename 'corbi.og_brep'

0 commit comments

Comments
 (0)