f2a6249af1
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> |
||
---|---|---|
.. | ||
api | ||
GraphQL.java | ||
IProvider.java | ||
README.md | ||
Web.java |
README.md
Adding a new endpoint
- 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.
- Make sure to correctly add the appropriate JSON and GraphQL annotations.
- Add a method to return the needed data to IProvider.
- Add a new REST endpoint to the Web::start method.
- Add a new GraphQL method to GraphQL
- Make sure to correctly add the appropriate GraphQL annotation.
- 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!