Open watta90 opened 8 years ago
This is currently not possible …
Kind regards,
Peter Kriens
On 9 okt. 2016, at 20:42, vatanbytyqi notifications@github.com wrote:
Hi,
How do you choose what to return when the primary endpoint is called on your REST api?
I would like to return a String when a user calls GET on /rest
I'm not able to find any documentation on how to achieve this.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/osgi/osgi.enroute.bundles/issues/68, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMPLuN9HhN3I0J7Tv8Jq4bxdHiU-DH0ks5qyTWTgaJpZM4KSExD.
that was sad.. Do you know if someone is working on this so I can follow up on that? Currently I don't have the time to make a contribution my self at the moment, hopefully in a couple of months.
Regards Vatan
The source code is https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.provider https://github.com/osgi/osgi.enroute.bundles/tree/master/osgi.enroute.rest.simple.provider
Since this is so little code it should not be very hard to add this feature here https://github.com/osgi/osgi.enroute.bundles/blob/master/osgi.enroute.rest.simple.provider/src/osgi/enroute/rest/simple/provider/RestMapper.java#L227 https://github.com/osgi/osgi.enroute.bundles/blob/master/osgi.enroute.rest.simple.provider/src/osgi/enroute/rest/simple/provider/RestMapper.java#L227
You could use a function that has some magic name like get$ to map to the empty path.
That said, you could also switch to JAX-RS. The OSGi enRoute REST API is incredibly easy to use but was not designed to allow the implementation of all possible REST APIs. Its primary goal was to support calls from the Javascript code into the java OSGI code.
Kind regards,
Peter Kriens
On 10 okt. 2016, at 13:04, vatanbytyqi notifications@github.com wrote:
that was sad.. Do you know if someone is working on this so I can follow up on that? Currently I don't have the time to make a contribution my self at the moment, hopefully in a couple of months.
Regards Vatan
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/osgi/osgi.enroute.bundles/issues/68#issuecomment-252588294, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMPLjjMlucAmxeJ_bOEItIhNQdxioiRks5qyhu3gaJpZM4KSExD.
I think the most natural system is to just use raw verbs get()
, post()
, etc. rather than a special path name like $
. Is there any problem with this approach? It was straightforward to implement this way, pretty much just removed the checks and error messages and it works: #85
Hi,
How do you choose what to return when the primary endpoint is called on your REST api?
I would like to return a String when a user calls GET on /rest
I'm not able to find any documentation on how to achieve this.