OCR-D / ocrd-webapi-implementation

4 stars 0 forks source link

workflow: execute workflow endpoint #11

Closed joschrew closed 2 years ago

joschrew commented 2 years ago

change/think about execute workflow endpoint. currently the workspace_id is provided as query-parameter. This is working, but this is not described in the api description. So either one has to be changed, api-description or implementation

joschrew commented 2 years ago

not totally correct what I wrote. I think implementation and api-description have both to be changed

MehmedGIT commented 2 years ago

Agree that the API description should be changed. POST /workflow/{workflow-id} (reference) should get an additional parameter workspace_id. What should be changed in the implementation part?

joschrew commented 2 years ago

I see two suitable options

joschrew commented 2 years ago

I created a Pull Request to extend the api. If this is accepted the method signature of the start_workflow Method should look like this: async def start_workflow(workflow_id: str, workspace_id: str = Body(), parameters: dict = Body()): (alternatively, maybe better: https://fastapi.tiangolo.com/tutorial/body/) A curl request would be like this: curl -X 'POST' 'http://localhost:8000/workflow/the-workflow-id' -H 'accept: application/json' -H 'Content-Type: application/json' -d '{ "workspace_id": "test", "parameters": { "test": 10 }}'

joschrew commented 2 years ago

closed because mentioned pull request was merged a while a go and functionality is implemented