dcrd icon indicating copy to clipboard operation
dcrd copied to clipboard

docs: document rpc api versioning process.

Open dnldd opened this issue 3 years ago • 4 comments

This documents the process expected to be followed by contributors in versioning JSON-RPC API endpoints.

work towards #2746.

dnldd avatar Mar 16 '22 23:03 dnldd

I think this update is awesome. Had a quick question.

From the previous issue, the two main approaches are:

  1. A single versioned endpoint for the entire RPC API, or
  2. Individual versioned endpoints for each RPC method.

I just want to clarify what you mean by "Per-RPC Versioning" and "versioned per-RPC endpoint" When you say those words, are you referring to the 2nd approach above, or just that the RPC API will have versions in general?

(The reason I ask is because I also couldn't tell from the previous issue which approach you were going to move forward with. But the pro/con writeup was definitely helpful)

matthawkins90 avatar Mar 17 '22 02:03 matthawkins90

After discussing the two approaches in chat with davec, versioning each RPC individually was the better approach and that is what this versioning process recommends. "Per-RPC Versioning" and "versioned per-RPC endpoint" are all referring to individual versioned endpoint for each RPC method here. Open to suggestions on wording it better. I will update the text to clearly indicate this where it unclear. I was supposed to comment on the issue regarding the preferred approach before writing the docs, missed a step there.

dnldd avatar Mar 17 '22 22:03 dnldd

I'm going to leave this in draft still and look to add a section for versioning websocket endpoints.

dnldd avatar Mar 18 '22 20:03 dnldd

Just realized having the default method name resolve to the current version of the endpoint will break consumers once they update. We don't want that, should be resolving to the older version instead. Will make the needed changes soon.

dnldd avatar Mar 24 '22 01:03 dnldd