Once again a little bugfix for the Go REST Server Library. The last fix also already made a not backward compatible function renaming of jwt.AddTokenToRequest() to jwt.AddToRequest(). Reason has been that the part Token is redundant through the package name. Now both are available but the old one has a comment marking it as deprecated. More about the project at PROJECTS → Go REST Server Library.
It’s only a minor fix regarding status codes. So far calling a handler with an unsupported (unimplemented) the status code 500 (internal server error) has been returned. More correct in the sense of RESTful APIs is instead the status code 405 (method not allowed). This code is now returned. More about the project at PROJECTS → Go REST Server Library.
Short time after verion 2.14.0 I had to release the version 2.15.0. Sadly it’s incompatible with its predecessor, but only with the new introduced Job method Path(). This now returns an instance of the type Path providing more detailed access to its parts. Beside getting these by index the Path now also contains accessors to Domain(), Resource(), and ResourceID(). The accessors provided by Job are now deprecated and will be removed at some time later when version 3 will be reased.
It contains two changes. The parts of a request path are now retrievable via Job.Part(index int) string. ResouceHandlers now can have methods better matching to REST than the standard methods. The mapping is POST to Create() GET to Read() PUT to Update() PATCH to Modify() DELETE to Delete() OPTION to Info() In case of a handler implementing both, e.g. Get() and Read(), the standard one will be taken. So here Get() due to the HTTP GET.