Projects tigase _server tigase-http-api Issues #122
Improved and refactor HTTP API implementation (#122)
Andrzej Wójcik (Tigase) opened 3 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 3 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 https://jte.gg as a templating engine.

Andrzej Wójcik (Tigase) commented 3 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.

wojciech.kapcia@tigase.net commented 3 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 3 years ago

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

Referenced from commit 8 months ago
Referenced from commit 8 months ago
Referenced from commit 8 months ago
Referenced from commit 7 months ago
Andrzej Wójcik (Tigase) referenced from other issue 7 months ago
wojciech.kapcia@tigase.net batch edited 6 months ago
Name Previous Value Current Value
Iterations
empty
tigase-server-9.0.0
wojciech.kapcia@tigase.net added to iteration "tigase-server-8.4.0" 6 months ago
wojciech.kapcia@tigase.net changed fields 6 months ago
Name Previous Value Current Value
Version
tigase-server-9.0.0
tigase-server-8.4.0, tigase-server-9.0.0
wojciech.kapcia@tigase.net added "Related" #149 6 months ago
Referenced from commit 4 months ago
issue 1 of 1
Type
Task
Priority
Normal
Assignee
Version
tigase-server-8.4.0, tigase-server-9.0.0
Issue Votes (0)
Watchers (2)
Reference
tigase/_server/tigase-http-api#122
Please wait...
Page is in error, reload to recover