Hello, Thembelani,

I have implemented a similar case in this app:

https://github.com/oliverwilms/irisrest/blob/master/src/App/REST.cls#:~:...

Important helper method is this:

/// Helper method
ClassMethod GetJSONFromRequest(Output obj As %DynamicObject) As %Boolean
{
    Set ok = 1
    Try {
        Set obj = ##class(%DynamicObject).%FromJSON(%request.Content)
    } Catch ex {
        Set ok = 0
    }
    Quit ok
}

Best regards,

Oliver

Hello, David, it looks like you get a nice small image.

I use a AWS free tier account. My screen seems to get stuck and all I can see is this:

Step 5/10 : RUN npm install
 ---> Running in 58ae96e0c62a

> node-sass@4.10.0 install /usr/src/app/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.10.0/linux_musl-x...
Download complete
Binary saved to /usr/src/app/node_modules/node-sass/vendor/linux_musl-x64-57/binding.node
Caching binary to /root/.npm/node-sass/4.10.0/linux_musl-x64-57_binding.node

> circular-json@0.5.7 postinstall /usr/src/app/node_modules/circular-json
> echo ''; echo "\x1B[1mCircularJSON\x1B[0m is in \x1B[4mmaintenance only\x1B[0m, \x1B[1mflatted\x1B[0m is its successor."; echo ''

\x1B[1mCircularJSON\x1B[0m is in \x1B[4mmaintenance only\x1B[0m, \x1B[1mflatted\x1B[0m is its successor.

> node-sass@4.10.0 postinstall /usr/src/app/node_modules/node-sass
> node scripts/build.js

Binary found at /usr/src/app/node_modules/node-sass/vendor/linux_musl-x64-57/binding.node
Testing binary
Binary is fine
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/karma/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1474 packages from 1384 contributors and audited 1611 packages in 53.388s
found 407 vulnerabilities (15 low, 122 moderate, 200 high, 70 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container 58ae96e0c62a
 ---> 4b0022ce43ef
Step 6/10 : COPY . .
 ---> ede198788bb5
Step 7/10 : RUN npm run build
 ---> Running in 7007e62b7eb2

> iris-explorer@1.1.0 build /usr/src/app
> ng build --prod

Browserslist: caniuse-lite is outdated. Please run next command `npm update caniuse-lite browserslist`

Hi, Michael,

I am interested to see how this can be solved in a good way. First thing came to my mind was to have a more generic table than teapot so multiple categories can be in one table. Then category can be one of the parameters to query on. I like to develop an example we can improve upon.

Are you willing to share your configuration / definition / code?

I looked for an example of API first and I found this app on OpenExchange:

InterSystems Open Exchange
 

https://github.com/drechema/iris-explorer

It did not build in my AWS environment ...

I started my own version of it and imported phoneapp which can be found here:

https://github.com/oliverwilms/iris-explorer

Hi, David, I found your app looking for an example of an API definition that can be used to define a REST app. I cloned your app and tried to build it, but the web image did not complete build. I tried to build IRIS image here:

oliverwilms/iris-explorer: Angular Application that use the standard API discovery in InterSystems IRIS in order to inspect existing APIs and create new APIs using Swagger 2.0 OpenAPI specification (github.com)

I added iris.script where I use ^%REST. It works doing something, but something is missing?