Open klapaukh opened 6 years ago
@klapaukh What are your thoughts on how closely the endpoints should support a CRUD model? If I recall correctly, the POST /job/ only creates a new job with name, author, case_id. I feel we should probably support providing a fully populated job for this endpoint. In this case, we should share validation code with the PATCH (and any future PUT endpoint).
As you said, the current version of POST does not support the creation of a fully populated job.
I like the idea of not supporting the full specification of a job with POST. And also not having a PUT. I think that it makes it easier because there is one way of doing each thing.
However, equally, I understand that as the project grows it may want to provide options to ensure that front ends and workflows different from the ones we are using can be easily supported. In which case we would want the functionality you mentioned.
So on the one hand I totally support the "do it when/if you need it" approach. On the other hand I'm thinking about the expectations of the functionality of a REST API with create/read/update semantics (though we also don't yet support delete and would likely only want to do a soft delete). I don't feel super-strongly about this so happy not to add work when we're tight on time. Would be nice to capture some of the requirements / gotchas as an issue though (e.g. "these fields aren't user settable").
Hmmmm..... no matter what we do, having the documentation clear on what the limitations are is definitely really important. I am currently working on documenting what is currently implemented and how it works in the project README. Someone should probably look over that to make sure that it is sensible and clear on a lot of these issues.
It would be worth fleshing out the ticket at https://github.com/alan-turing-institute/science-gateway/issues/12 to specify what the docs should contain.
PATCH /job/ should check that: