Skip to content

Commit 4e9fbe7

Browse files
authored
Update README.md
1 parent 39522db commit 4e9fbe7

1 file changed

Lines changed: 47 additions & 1 deletion

File tree

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ From the terminal,in the name space where your class exists :
2929
Do objJSON.%ToJSON()
3030

3131
Set newObj = ##class(SampleApps.Serialize.MapTesting).%New()
32-
Do newObj.Import(,,objJSON)
32+
Do newObj.Import(objJSON)
3333
set tSC = newObj.%Save()
3434
write newOBJ.%Id()
3535
```
@@ -213,6 +213,52 @@ This way, once our template class is compiled, we could do:
213213
## Sample Application
214214
There are some classes that I used to build some of the examples. There are others testing other features. You can take a look at them in the package `SampleApps.Serialize`
215215

216+
## REST Services
217+
Just a bunch of REST services to make use and test this functionality. You can find them in `SampleApps.Serialize.REST`class:
218+
219+
Service | Path | HTTP Method
220+
------- | ---- | -----------
221+
Get object in JSON format | /object/json/:class/:id/:ddlevel/:map | GET
222+
| /object/json/:class/:id/:ddlevel | GET
223+
| /object/json/:class/:id" | GET
224+
Load object from JSON | /object/json/:class/:ddlevel/:map | POST
225+
| /object/json/:class/:ddlevel | POST
226+
| /object/json/:class | POST
227+
(assuming there is a property _classname_ in input JSON) | /object/json | POST
228+
Update an object from JSON input | /object/json/:class/:id | PUT
229+
Delete an object with certain ID | NOT YET IMPLEMENTED | DELETE
230+
Get serialized object in format especified by serialization method | /object/serial/:templateclass/:serializationmethod/:class/:id/:ddlevel | GET
231+
| /object/serial/:templateclass/:serializationmethod/:class/:id |GET
232+
Load object from serialized stream | /object/serial/:templateclass/:serializationmethod/:class/:ddlevel | POST
233+
| /object/serial/:templateclass/:serializationmethod/:class | POST
234+
235+
<!-- Update object -->
236+
<!-- NOT YET IMPLEMENTED
237+
<Route Url="/object/serial/:templateclass/:serializationmethod/:class/:id" Method="PUT" Call="UpdateSerial" />
238+
-->
239+
240+
<!-- Get a JSON document that contains export/import MAPs associated to a particular :class -->
241+
<Route Url="/map/:class/:map/:type" Method="GET" Call="GetStdMap"/>
242+
<Route Url="/map/:class/:map" Method="GET" Call="GetStdMap"/>
243+
<Route Url="/map/:class" Method="GET" Call="GetStdMap"/>
244+
245+
<!-- Set export/import MAPs from a JSON document -->
246+
<Route Url="/map/:override/:filter" Method="POST" Call="LoadStdMap"/>
247+
<Route Url="/map" Method="POST" Call="LoadStdMap"/>
248+
<Route Url="/map/chgclass/:targetclass/:override/:filter" Method="POST" Call="LoadStdMapToOther"/>
249+
<Route Url="/map/chgclass/:targetclass" Method="POST" Call="LoadStdMapToOther"/>
250+
251+
<!-- Test methods - GET -->
252+
<Route Url="/request" Method="GET" Call="Request"/>
253+
254+
<!-- Test methods - POST -->
255+
<Route Url="/echo" Method="POST" Call="Echo"/>
256+
<Route Url="/echojson" Method="POST" Call="EchoJSON"/>
257+
<Route Url="/echo/:txt" Method="POST" Call="Echo"/>
258+
</Routes>
259+
260+
261+
216262
## End
217263

218264
I hope this code can help you in any way.

0 commit comments

Comments
 (0)