API schema

Hi all

We've recently had our first successful run of an Open-Sound-Control API to Empty Epsilon.

Our goal is for this API to serve as a platform to connect many different endpoints to the game server, making it easier for technical non-developers to extend the game's UI capabilities easily.

The server maps EE Object-oriented LUA HTTP API to OSC address space, so that `getPlayerShip(-1):getHull()` and `getPlayerShip(-1):setHull(...)` both maps to/from `/ee/player-ship/-1/hull` depends on the direction of the message.

It's technically open source (Typescript over nodeJs), but it's part of a larger server that does several other things. We'd be glad to extract it as a CLI-ready application if someone here would find value in it.

The server is using a custom JSON schema to do the mapping automatically. this means it can support the entire LUA API schema, if it was expressed in a machine-friendly way with the required details.
I was looking into the code that generates the documentation HTML, as it seems to be the closest thing there is right now, but my python skills are low, and I think there's a lot that needs doing in that area.

The schema We're using right now looks like:

{
"global": {
"getPlayerShip": {
"arguments": ["integer"],
"type": ["PlayerSpaceship"]
}
},
"PlayerSpaceship": {
"$inherits": "SpaceShip"
},
"SpaceShip": {
"$inherits": "ShipTemplateBasedObject",
"getSystemHealth": {
"arguments": ["ESystem"],
"type": ["float"]
},
"setSystemHealth": {
"arguments": ["ESystem", "float"],
"type": []
},
"getSystemHeat": {
"arguments": ["ESystem"],
"type": ["float"]
},
"setSystemHeat": {
"arguments": ["ESystem", "float"],
"type": []
},
...

What will it take to produce this level of schema for the entire API?

Sign In or Register to comment.