CHANGED: removed obsolete API methods from BlocksResource

CHANGED: added missing response schemas
This commit is contained in:
Kc 2018-10-19 12:35:15 +02:00
parent a075705885
commit d2aab4b446
3 changed files with 8 additions and 119 deletions

View File

@ -4,13 +4,9 @@
<context path="Api">
<context path="BlocksResource">
<context path="GET">
<translation key="operation:description" template="Gibt ein Array der letzten 50 Blöcke zurück, die von deinem Account erzeugt wurden" />
<translation key="success_response:description" template="Die Blöcke" />
</context>
<!--<context path="GET address:address">
<translation key="operation:description" template="returns an array of the 50 last blocks generated by a specific address in your wallet" />
<translation key="success_response:description" template="the blocks" />
<!--<context path="GET signature">
<translation key="operation:description" template="returns the block that matches the given signature" />
<translation key="success_response:description" template="the block" />
</context>
<context path="GET first">
<translation key="operation:description" template="returns the genesis block" />

View File

@ -4,13 +4,9 @@
<context path="Api">
<context path="BlocksResource">
<context path="GET">
<translation key="operation:description" template="returns an array of the 50 last blocks generated by your accounts" />
<translation key="success_response:description" template="the blocks" />
</context>
<context path="GET address:address">
<translation key="operation:description" template="returns an array of the 50 last blocks generated by a specific address in your wallet" />
<translation key="success_response:description" template="the blocks" />
<context path="GET signature">
<translation key="operation:description" template="returns the block that matches the given signature" />
<translation key="success_response:description" template="the block" />
</context>
<context path="GET first">
<translation key="operation:description" template="returns the genesis block" />

View File

@ -44,109 +44,6 @@ public class BlocksResource {
this.apiErrorFactory = apiErrorFactory;
}
@GET
@Operation(
description = "returns an array of the 50 last blocks generated by your accounts",
extensions = @Extension(name = "translation", properties = {
@ExtensionProperty(name="path", value="GET"),
@ExtensionProperty(name="description.key", value="operation:description")
}),
responses = {
@ApiResponse(
description = "the blocks",
//content = @Content(schema = @Schema(implementation = ???))
extensions = {
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="success_response:description")
})
}
),
@ApiResponse(
responseCode = "422",
description = "wallet does not exist",
content = @Content(schema = @Schema(implementation = ApiErrorMessage.class)),
extensions = {
@Extension(properties = {
@ExtensionProperty(name="apiErrorCode", value="201")
}),
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="ApiError/201")
})
}
)
}
)
public String getBlocks() {
Security.checkApiCallAllowed("GET blocks", request);
throw new UnsupportedOperationException();
}
@GET
@Path("/address/{address}")
@Operation(
description = "returns an array of the 50 last blocks generated by a specific address in your wallet",
extensions = @Extension(name = "translation", properties = {
@ExtensionProperty(name="path", value="GET address:address"),
@ExtensionProperty(name="description.key", value="operation:description")
}),
responses = {
@ApiResponse(
description = "the blocks",
//content = @Content(schema = @Schema(implementation = ???)),
extensions = {
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="success_response:description")
})
}
),
@ApiResponse(
responseCode = "400",
description = "invalid address",
content = @Content(schema = @Schema(implementation = ApiErrorMessage.class)),
extensions = {
@Extension(properties = {
@ExtensionProperty(name="apiErrorCode", value="102")
}),
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="ApiError/102")
})
}
),
@ApiResponse(
responseCode = "422",
description = "wallet does not exist",
content = @Content(schema = @Schema(implementation = ApiErrorMessage.class)),
extensions = {
@Extension(properties = {
@ExtensionProperty(name="apiErrorCode", value="201")
}),
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="ApiError/201")
})
}
),
@ApiResponse(
responseCode = "422",
description = "address does not exist in wallet",
content = @Content(schema = @Schema(implementation = ApiErrorMessage.class)),
extensions = {
@Extension(properties = {
@ExtensionProperty(name="apiErrorCode", value="202")
}),
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="ApiError/202")
})
}
)
}
)
public String getBlocks(@PathParam("address") String address) {
Security.checkApiCallAllowed("GET blocks/address/" + address, request);
throw new UnsupportedOperationException();
}
@GET
@Path("/{signature}")
@Operation(
@ -306,7 +203,7 @@ public class BlocksResource {
responses = {
@ApiResponse(
description = "the block",
//content = @Content(schema = @Schema(implementation = ???)),
content = @Content(schema = @Schema(implementation = BlockData.class)),
extensions = {
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="success_response:description")
@ -621,7 +518,7 @@ public class BlocksResource {
responses = {
@ApiResponse(
description = "the block",
//content = @Content(schema = @Schema(implementation = ???)),
content = @Content(schema = @Schema(implementation = BlockData.class)),
extensions = {
@Extension(name = "translation", properties = {
@ExtensionProperty(name="description.key", value="success_response:description")