Projects tigase _server tigase-http-api Issues #122
Improved and refactor HTTP API implementation (#122)
In Progress
Andrzej Wójcik (Tigase) opened 2 years ago

The current implementation is written in Groovy which we want to get rid of as it causes huge delays during startup (scripts compilation) and is rather a huge dependency (over 7MB). Additionally, writing code (in the HTTP API main code or in scripts) is error-prone.

Due to that, we need to rewrite parts of the HTTP API which is written in Groovy (mainly REST API). We may leave an option to use groovy to provide user-create scripts, but main part of the HTTP API should work without the requirement of having a Groovy in the classpath.

While at it, it should be considered to work on #issue #92 and @wojtek suggestion to use JAX-RS API for implementation of our REST API (this would make API creation simpler and more unified).

Andrzej Wójcik (Tigase) commented 2 years ago

I've reimplemented the core of the REST API by implementing a subset of JAX-RS specifications. This allowed me to reduce dependency on Groovy.

For now, Groovy is still required for index, setup, and old REST API groovy scrips which will be removed after they are reimplemented in Java. Before removing Groovy, index and setup need to be reimplemented by using as a templating engine.

Andrzej Wójcik (Tigase) commented 2 years ago

@wojtek There are 2 handlers implemented as an example. Could you look at AvatarGetHandler and UsersHandler to verify that API is OK?

As for setup/index, we may try to move them to use JAX-RS to make reading parameters simpler. commented 2 years ago

I took a quick look and IMHO looks ok, and more readable.

UsersHandler is just a dummy stub implementation for now - correct?

Andrzej Wójcik (Tigase) commented 2 years ago

Yes, for testing sync & async and returning an object with a list.

Referenced from commit 4 months ago
Referenced from commit 4 months ago
Referenced from commit 4 months ago
Referenced from commit 2 months ago
Andrzej Wójcik (Tigase) referenced from other issue 2 months ago batch edited 2 months ago
Name Previous Value Current Value
tigase-server-9.0.0 added to iteration "tigase-server-8.4.0" 2 months ago changed fields 2 months ago
Name Previous Value Current Value
tigase-server-8.4.0, tigase-server-9.0.0 added "Related" #149 1 month ago
issue 1 of 1
tigase-server-8.4.0, tigase-server-9.0.0
Issue Votes (0)
Watchers (2)
Please wait...
Page is in error, reload to recover