ServerAPI/src/main/java/xyz/etztech/serverapi/web
Etzelia f2a6249af1 schedule (#1)
Schedule kick

Signed-off-by: Etzelia <etzelia@hotmail.com>

Chat API (#7)

Chat API

Signed-off-by: Etzelia <etzelia@hotmail.com>

Reviewed-on: https://git.etztech.xyz/Minecraft/ServerAPI/pulls/7
Reviewed-by: ZeroHD <joey@ahines.net>

Add token auth and POST endpoints (#6)

Add token auth and POST endpoints

Signed-off-by: Etzelia <etzelia@hotmail.com>

Reviewed-on: https://git.etztech.xyz/Minecraft/ServerAPI/pulls/6
Reviewed-by: ZeroHD <joey@ahines.net>

Change QueryAPI to PingAPI and add PluginAPI (#4)

typo

Fix null fields

Signed-off-by: Etzelia <etzelia@hotmail.com>

Change QueryAPI to PingAPI and add PluginAPI

Signed-off-by: Etzelia <etzelia@hotmail.com>

Reviewed-on: https://git.etztech.xyz/Minecraft/ServerAPI/pulls/4
Reviewed-by: ZeroHD <joey@ahines.net>

Fix conflicting name (#3)

Fix conflicting name

Signed-off-by: Etzelia <etzelia@hotmail.com>

Reviewed-on: https://git.etztech.xyz/Minecraft/ServerAPI/pulls/3

Reviewed-on: https://git.birbmc.com/BirbMC/serverapi/pulls/1
Co-Authored-By: Etzelia <etzelia@hotmail.com>
Co-Committed-By: Etzelia <etzelia@hotmail.com>
2021-03-16 01:54:15 +00:00
..
api schedule (#1) 2021-03-16 01:54:15 +00:00
GraphQL.java schedule (#1) 2021-03-16 01:54:15 +00:00
IProvider.java schedule (#1) 2021-03-16 01:54:15 +00:00
README.md schedule (#1) 2021-03-16 01:54:15 +00:00
Web.java schedule (#1) 2021-03-16 01:54:15 +00:00

README.md

Adding a new endpoint

  1. Create a new <endpoint>API class in api.
    • Make sure to correctly add the appropriate JSON and GraphQL annotations.
      Look at other classes for examples.
    • NOTE: If anything returned could be null, make sure to instead provide an appropriate zero-value property, otherwise GraphQL will choke.
      See PluginAPI::new for an example.
  2. Add a method to return the needed data to IProvider.
  3. Add a new REST endpoint to the Web::start method.
  4. Add a new GraphQL method to GraphQL
    • Make sure to correctly add the appropriate GraphQL annotation.
  5. Modify both ServerAPI and MockProvider to fulfill the IProvider interface.

Testing

ServerRunner should start up the API using MockProvider.

If possible, a real test on a running Minecraft server would ideal!