Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

endpoint /seldon.json not returning the file #732

Merged
merged 4 commits into from
Jul 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/python/python_component.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ If you want more control you can provide a low-level methods that will provide a

## User Defined Exceptions
If you want to handle custom exceptions define a field `model_error_handler` as shown below:
```
```python
model_error_handler = flask.Blueprint('error_handlers', __name__)
```
An example is as follow:
Expand Down
2 changes: 1 addition & 1 deletion python/seldon_core/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def handle_invalid_usage(error):

@app.route("/seldon.json", methods=["GET"])
def openAPI():
return send_from_directory('', "seldon.json")
return send_from_directory('', "openapi/seldon.json")

@app.route("/predict", methods=["GET", "POST"])
def Predict():
Expand Down
6 changes: 6 additions & 0 deletions python/tests/test_model_microservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,12 @@ def test_model_gets_meta():
assert j["meta"]["metrics"][0]["key"] == user_object.metrics()[0]["key"]
assert j["meta"]["metrics"][0]["value"] == user_object.metrics()[0]["value"]

def test_model_seldon_json_ok():
user_object = UserObject()
app = get_rest_microservice(user_object)
client = app.test_client()
rv = client.get("/seldon.json")
assert rv.status_code == 200

def test_proto_ok():
user_object = UserObject()
Expand Down