Closed tapmch closed 1 month ago
Is that a personal opinion or do you have some sort of industry standard document that you can reference?
Honestly I personally don't really care, and I know people have been fighting over these conventions since forever. At this point I strongly believe what matters is that you choose one way to do it, and stay consistent with it.
I agree with @nscuro.
According to IETF RFC 9110, PUT can also be for creates:
The PUT method requests that the state of the target resource be created or replaced with the state defined by the representation enclosed in the request message content
Best not to spend too much time on semantics here.
PUT is idempotent (where POST is not) which in my opinion makes PUT more suitable for updates. But I agree, I didn't want to start a long discussion here. Feel free to close the issue.
https://restfulapi.net/http-methods/ It is a common practice to use put for updates, patch for partial updates and post for creating resources. The response for creating with post is 201 (created), for updating 200 (ok). All rest APIs I know, use this pattern except alpine. The issue is not a swagger, it's the implementation in dtrack and alpine in using http verbs. But I think, it will be a big and incompatible change with an impact on frontend and all public APIs. So dtrack should keep its implementation.
Closing for now, but still appreciate everyone's input. I think we can / should re-evaluate this when we start adding /v2
endpoints, where we don't have to worry about breaking changes.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Current Behavior
Steps to Reproduce
Expected Behavior
POST -> create PUT -> update
Dependency-Track Version
4.7.x
Dependency-Track Distribution
Container Image
Database Server
PostgreSQL
Database Server Version
13.5
Browser
Google Chrome
Checklist