SysML-v2-API-Services
SysML-v2-API-Services copied to clipboard
referencedCommit and head are null which should not be allowed
From what I can gather from the "Systems Modeling Application Programming Interface (API) and Services" version 1.0, release 2022-11 the property referencedCommit
and head
(which redefines referencedCommit) of the Branch
class are not nullable.
When executing the following HTTP request
http://sysml2-sst.intercax.com:9000/projects/8e085296-7e28-4d1d-bbbc-d28beffac3d7/branches
it is apparent that the server returns faulty data.
It could be the other way around, API is correct and diagram is wrong? When you create a new project, a new "main" branch is also created with zero commits on it, so there is no commit to point to. Github works the same way, when you create a new repo/project you will have a default "main" branch with zero commits.
I see 3 solutions:
- Keep nullable as implemented
- Automatic creation of empty "initialCommit" + "main" branch when creating a new project
- Separate endpoint for "initialCommit" that you POST agains project (not branch)
Number 1 mimics GitHub, a known mental model. Number 2 removes the need for nullable head/refCommit, so is maybe the preferred solution.