Valandur / Web-API

RESTful web server for Minecraft Sponge including an admin panel
https://valandur.github.io/Web-API/
MIT License
66 stars 17 forks source link

Can't create a new redprotect region #102

Closed oblx closed 6 years ago

oblx commented 6 years ago

I POST this stuff to api/v5/red-protect/region :

{
  "id": "derinku-main-cuboid",
  "max": {
    "x": 2248,
    "y": 60,
    "z": -5351
  },
  "min": {
    "x": 2375,
    "y": 0,
    "z": -5224
  },
  "name": "string",
  "world": {
    "loaded": true,
    "name": "biomed",
    "uuid": "7bcc7be5-102d-4f25-bf62-1cb5f6828eff"
  },
  "admins": [],
  "canDelete": true,
  "date": "string",
  "flags": {},
  "leaders": [],
  "members": [],
  "priority": 0,
  "tpPoint": {},
  "welcomeMessage": "Hello there !"
}

Callback is :

{
  "status": 400,
  "error": "Unrecognized field \"loaded\" (class valandur.webapi.integration.redprotect.CachedRegion), not marked as ignorable (14 known properties: \"max\", \"welcomeMessage\", \"flags\", \"leaders\", \"name\", \"date\", \"world\", \"tpPoint\", \"members\", \"id\", \"priority\", \"min\", \"canDelete\", \"admins\"])\n at [Source: (valandur.webapi.shadow.org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 15, column: 19] (through reference chain: valandur.webapi.integration.redprotect.CachedRegion[\"loaded\"])"
}

If I remove loaded then it tells me that uuid is not recognized :

{
  "status": 400,
  "error": "Unrecognized field \"uuid\" (class valandur.webapi.integration.redprotect.CachedRegion), not marked as ignorable (14 known properties: \"max\", \"welcomeMessage\", \"flags\", \"leaders\", \"name\", \"date\", \"world\", \"tpPoint\", \"members\", \"id\", \"priority\", \"min\", \"canDelete\", \"admins\"])\n at [Source: (valandur.webapi.shadow.org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 16, column: 14] (through reference chain: valandur.webapi.integration.redprotect.CachedRegion[\"uuid\"])"
}

If I remove uuid then it wants a world name :

{
  "status": 400,
  "error": "The region needs a world"
}

With various combination (uuid value instead of world value) it always tells me that the region needs a world.

Valandur commented 6 years ago

Have you tried doing: "world": "7bcc7be5-102d-4f25-bf62-1cb5f6828eff"? I believe that should work

oblx commented 6 years ago

What a noob I am.

I only tried with undashed uuid. It now needs a TP point, I will close issue if it's a success.

2018-06-26 9:50 GMT+02:00 Marco (Valandur) notifications@github.com:

Have you tried doing: "world": "7bcc7be5-102d-4f25-bf62-1cb5f6828eff"? I believe that should work

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Valandur/Web-API/issues/102#issuecomment-400214302, or mute the thread https://github.com/notifications/unsubscribe-auth/ABwOBg2S0cnmmxHZCaC8ciKJHjIKvncKks5uAefPgaJpZM4U2rcI .