[progress Communities] [progress Openedge Abl] Forum Post: Jsdosession Catalog Error:...

  • Thread starter Thread starter Marko Myllymäki
  • Start date Start date
Status
Not open for further replies.
M

Marko Myllymäki

Guest
It seems that the catalog for a rest service can contain only one read operation for each resource, otherwise JSDOSession gives an error message when trying to add the catalog (jsdosession.addCatalog). I am trying to create these kind of rest services: /customers for returning all customers /customers/1 for returning customer #1 I was hoping to handle these in a single class (customers.cls) having two read methods, one for each case. Now it seems that because of the above mentioned restriction, I have to create two separate classes and also change the rest URIs for something like this: /customerlist for returning all customers /customers/1 for returning customer #1 Or have I missed something? I am currently using the static catalog file (service.json) which is generated by Development Studio based on the class annotations. OpenEdge version is 11.6. I already tried to use a rest call to dynamically create/modify the catalog instead of using the static file and it seems to work but is there an easier workaround (e.g. with annotation)? Currently the annotations for those read methods are like this: @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false"). @progress.service.resourceMapping(type="REST", operation="read", URI="?filter=~{filter~}", alias="", mediaType="application/json"). @openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false"). @progress.service.resourceMapping(type="REST", operation="read", URI="/~{customerid~}", alias="", mediaType="application/json"). The latter one is used for returning a specific customer.

Continue reading...
 
Status
Not open for further replies.
Back
Top