go to post Evgeny Shvarov · Nov 11 Or just add a method in a cube class that does what you want and call it via: %cube.YourMethod(%source.%Id())
go to post Evgeny Shvarov · Nov 11 you can go for: $property(%source.%PackageName()_"."_%source.%ClassName(),"client_name")
go to post Evgeny Shvarov · Nov 10 But I must say Postman seems as a great tool to debug REST API in IRIS, even while debugging local stuff. And it can build collections on the fly on open-api spec provided - very convenient!
go to post Evgeny Shvarov · Nov 10 Hi @Eduard Lebedyuk ! Unfortunately, this approach is not working (at least for me) while using ^%REST approach and disp->impl implementation classes schema: If I put this into the impl classmethod, the only thing I'm getting back in Postman is 1:
go to post Evgeny Shvarov · Nov 10 Yes. The initial idea for intersystemsdc was to avoid waiting on the Docker build process to install IPM and other syntax sugar and good stuff from OEX. So, maybe we don't need intersystemsdc now very much to always get along with official containers set.
go to post Evgeny Shvarov · Nov 9 It is also possible to install Python packages along with IPM via requirements.txt entry. In case it helps anyhow.
go to post Evgeny Shvarov · Oct 28 Thanks @Eduard Lebedyuk ! I'll give it a try! Will it work for POST requests too? And is it for Postman only? E.g. if I use swagger-ui how could I get this page displayed?
go to post Evgeny Shvarov · Oct 26 Another one-liner suggested by @Robert Cemper recently: k ^SPOOL s %io=$I O 2 u 2 ZW %anyvariable c 2 u %io E.g. if you want to expose the content of %request during REST API method debugging, to write all the contents of %request to ^SPOOL global: k ^SPOOL s %io=$I O 2 u 2 ZW %request c 2 u %io and then ZW ^SPOOL in the terminal.
go to post Evgeny Shvarov · Oct 26 It is a global, again, though... But a very interesting and useful way to convert any write to a device into a global. Deserves a one liner input!
go to post Evgeny Shvarov · Oct 26 Thank you, @Robert Cemper ! This works like a charm! So, in my case, I also wanted to see what's in a stream object that comes into the method (you may ask me how I don't know this, as it is method I coded? ) I don't, as it is a generated one via %^REST): ClassMethod submitForm(formData As %Stream.Object) As %Stream.Object { set formDataObj= {}.%FromJSON(formData.Read()) k ^SPOOL s %io=$I O 2 u 2 do formDataObj.%ToJSON() c 2 u %io return $$$OK And then I do a REST API call and can see data in the terminal with zw ^SPOOL global: USER>zw ^SPOOL ^SPOOL(1,1)="{""amount"":0,""name"":""John Doe"",""taxid"":""AB123456C"",""nationality"":""british"",""email"":""john.doe@example.com""}" ^SPOOL(1,2147483647)="{67504,40535{2{" Simple and easy! Fantastic, @Robert Cemper !
go to post Evgeny Shvarov · Oct 25 Thanks, @Robert Cemper ! But here I'm more interested in debugging the REST API implementation method, so it is not very useful in this case, right?
go to post Evgeny Shvarov · Oct 25 Wow, thanks @David Hockenbroch ! Is it as simple as that? So when we receive a web call, it is all about the %request with the Method and content filled? This could also be the way to unit-test REST-API methods
go to post Evgeny Shvarov · Oct 25 Hi Ed @Eduard Lebedyuk ! Where do I see this displayed data by: do ##class(%CSP.Utils).DisplayAllObjects()?
go to post Evgeny Shvarov · Oct 25 This works like a charm, @David Hockenbroch ! I'd also add to a VSCode a convenient extra link to see all the errors of such like here: "links": { "UnitTest Portal": "${serverUrl}/csp/sys/%25UnitTest.Portal.Home.cls?$NAMESPACE=IRISAPP", "Error Log": "${serverUrl}/csp/sys/op/UtilSysAppErrorNamespaces.csp" }
go to post Evgeny Shvarov · Oct 24 Neat! Didn't know it is possible to use regular expressions in the map! Thanks for sharing, @Kurro Lopez !
go to post Evgeny Shvarov · Oct 20 Hi @Brett Saviano ! Tried it! Here is the feedback: 1 - can we add the link to the VSCode extension to be installed? I spent some time before I understood that, besides InterSystems ObjectScript, I need to install a special ObjectScript Extension pack . 2 - to make a REST API call I need to fill all the fields manually. Even I have an Open API spec class. Is it possible to read from it and provide all the fields ready to for tests? Filed a task and an idea. 3. Wasn't able to start debugging: faced the following error:
go to post Evgeny Shvarov · Oct 19 Also, often we want to switch to our own endpoint automatically instead of default one. These 3 lines in Dockerfile will do the thing. RUN old=http://localhost:52773/crud/_spec && \ new=http://localhost:52773/your/api/_spec && \ sed -i "s|$old|$new|g" /usr/irissys/csp/swagger-ui/swagger-initializer.js