^%REST can generate REST API classes that handle calls listed in Open API spec.
It'd be great if the lib could also generate unittests for all the implementation methods.
Tests could leverage approach, provided by David Hockenbroch here, which helps to setup %request environment for a given REST API method:
set %request = ##class(%CSP.Request).%New() set %request.ContentType = "application/json" set %request.Method = "POST" set %request.Content = ##class(%CSP.CharacterStream).%New() set json = {}.%New() set json.firstname = "David" set json.lastname = "Hockenbroch" do %request.Content.Write(json.%ToJSON())
Thank you for submitting the idea. The status has been changed to "Community Opportunity".
Stay tuned!