Skip to content

Commit

Permalink
feat: extract post systems props to a separate class
Browse files Browse the repository at this point in the history
  • Loading branch information
lyuyangh committed May 10, 2022
1 parent e0624f3 commit 581df31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions backend/src/impl/default_controllers_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
from explainaboard_web.models.datasets_return import DatasetsReturn
from explainaboard_web.models.system import System
from explainaboard_web.models.system_analyses_return import SystemAnalysesReturn
from explainaboard_web.models.system_create_props import SystemCreateProps
from explainaboard_web.models.system_info import SystemInfo
from explainaboard_web.models.system_outputs_return import SystemOutputsReturn
from explainaboard_web.models.systems_analyses_body import SystemsAnalysesBody
from explainaboard_web.models.systems_body import SystemsBody
from explainaboard_web.models.systems_return import SystemsReturn
from explainaboard_web.models.task import Task
from explainaboard_web.models.task_category import TaskCategory
Expand Down Expand Up @@ -146,7 +146,7 @@ def systems_get(
)


def systems_post(body: SystemsBody) -> System:
def systems_post(body: SystemCreateProps) -> System:
"""
aborts with error if fails
TODO: error handling
Expand Down
21 changes: 12 additions & 9 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,7 @@ paths:
content:
application/json:
schema:
type: object
properties:
metadata:
$ref: "#/components/schemas/SystemCreateProps"
system_output:
$ref: "#/components/schemas/SystemOutputProps"
custom_dataset:
$ref: "#/components/schemas/SystemOutputProps"
required: [metadata, system_output]
$ref: "#/components/schemas/SystemCreateProps"
responses:
"200":
description: OK
Expand Down Expand Up @@ -651,6 +643,17 @@ components:
required: [task_metadata_id, task_name]

SystemCreateProps:
type: object
properties:
metadata:
$ref: "#/components/schemas/SystemMetadata"
system_output:
$ref: "#/components/schemas/SystemOutputProps"
custom_dataset:
$ref: "#/components/schemas/SystemOutputProps"
required: [metadata, system_output]

SystemMetadata:
type: object
properties:
task:
Expand Down

0 comments on commit 581df31

Please sign in to comment.