REST Services Cataloging

I've been building up a REST services API, consisting of a dozen or so classes referenced from a Dispatch class, which has route mappings for the first piece of the URI.  I'd like to have the Dispatch class be able to output all of the available Services, with some documentation.  Is there something like a %Library resource that I could use to pull this information from each of the classes?

Thanks

Chris

  • 0
  • 0
  • 447
  • 1
  • 6

Answers

Unfortunately there is no such thing. Would be great to have this feature. Currently in my projects I manually write all possible paths, for example here.

Chris,

we are currently working on REST discovery and documentation, so expect more in the future. Currently, your best option is to manually document your URI paths. Personally, I find Swagger a very good tool to document REST endpoints as it also allows you to test interfaces and to generate clients for multiple languages.

Hey Stefan,

how is the progress of your investigation and your development here?
Does your implementation will support swagger/openAPI and its server-side code generation?

Thanks!

Patrick

Hello All,

I'd loved to heard more about that,

I was working on something like that, inspired by "action dispatcher" from Rails Framework, but for now I didn't  succeed.

Hello Chris,

Are those "action classes" following a pattern? In other words: do you have some basic repeated structure from whiuch your REST API is made of? If yes, then the "action dispatcher" can be much less complex by using URL path encoded dispatch instead of routing. I had an example doing that for Ensemble (https://community.intersystems.com/post/creating-restful-service-using-ensemble) quite a time ago. It Works for non-Ensemble services too. 

The key is that you have a single dispatch method in your "action dispatcher", which calls the static methods of your "action classes" AND the class name of it somehow derived from a "movable part" of your URL path.

Comments