Skip to content
Snippets Groups Projects
Commit 4b906847 authored by Cornelia Michlits's avatar Cornelia Michlits
Browse files

104 - ontology change endpoint types as suggested

Former-commit-id: 441933e6
parent cfc4a343
No related branches found
No related tags found
1 merge request!42Fixed the query service tests
......@@ -48,26 +48,22 @@ def suggest():
res = {"success": False, "message": str(e)}
return jsonify(res), 500
@app.route('/api/units/validate', methods=["POST"], endpoint='validate')
@app.route('/api/units/validate/<unit>', methods=["GET"], endpoint='validate')
@swag_from('validate.yml')
def valitate():
input_json = request.get_json()
def valitate(unit):
try:
unit = str(input_json['ustring'])
res = validator(stringmapper(unit))
res = validator(unit)
return str(res), 200
except Exception as e:
print(e)
res = {"success": False, "message": str(e)}
return jsonify(res)
@app.route('/api/units/uri', methods=["GET"], endpoint='uri')
@app.route('/api/units/uri/<uname>', methods=["GET"], endpoint='uri')
@swag_from('geturi.yml')
def geturi():
input_json = request.get_json()
def geturi(uname):
try:
name = str(input_json['uname'])
res = get_uri(name)
res = get_uri(uname)
return jsonify(res), 200
except Exception as e:
print(e)
......
......@@ -5,16 +5,11 @@ consumes:
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
- in: "path"
type: "string"
name: "uname"
description: "to-do description"
required: true
schema:
type: "object"
properties:
uname:
type: "string"
example : "metre"
responses:
200:
description: "OK"
......
......@@ -5,16 +5,11 @@ consumes:
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
- in: "path"
type: "string"
name: "unit"
description: "to-do description"
required: true
schema:
type: "object"
properties:
ustring:
type: "string"
example : "metre"
responses:
200:
description: "OK"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment