^%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.
This idea was implemented by Developer Community member(s). Please check the solution in the comments.
@Guest , @Guest , @Guest thank you for implementing this idea.
🖥 Download the app here: IrisOASTestGen