Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Naksha_2.2.30
- Added `UnprocessableEntity` error-code mapping to HTTP 422.

## Naksha_2.2.29
- Fixed SQL injection via property names in property search by whitelisting allowed characters.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ mavenPassword=YourPassword
# - here-naksha-lib-core/src/main/com/here/naksha/lib/core/NakshaVersion (static property: latest)
# - here-naksha-app-service/src/main/resources/swagger/openapi.yaml (info.version property)
# - CHANGELOG.md
version=2.2.29
version=2.2.30

Original file line number Diff line number Diff line change
Expand Up @@ -524,13 +524,15 @@ public void sendErrorResponse(@NotNull RoutingContext routingContext, @NotNull T
}
}

private @NotNull HttpResponseStatus mapErrorToHttpStatus(final @NotNull XyzError xyzError) {
static @NotNull HttpResponseStatus mapErrorToHttpStatus(final @NotNull XyzError xyzError) {
if (xyzError.equals(XyzError.EXCEPTION)) {
return HttpResponseStatus.INTERNAL_SERVER_ERROR;
} else if (xyzError.equals(XyzError.NOT_IMPLEMENTED)) {
return HttpResponseStatus.NOT_IMPLEMENTED;
} else if (xyzError.equals(ILLEGAL_ARGUMENT)) {
return HttpResponseStatus.BAD_REQUEST;
} else if (xyzError.equals(XyzError.UNPROCESSABLE_ENTITY)) {
return HttpResponseStatus.UNPROCESSABLE_ENTITY;
} else if (xyzError.equals(XyzError.PAYLOAD_TOO_LARGE)) {
return HttpResponseStatus.REQUEST_ENTITY_TOO_LARGE;
} else if (xyzError.equals(XyzError.BAD_GATEWAY)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ servers:
info:
title: "Naksha Hub-API"
description: "Naksha Hub-API is a REST API to provide simple access to geo data."
version: "2.2.29"
version: "2.2.30"

security:
- AccessToken: [ ]
Expand Down Expand Up @@ -1536,6 +1536,12 @@ components:
error: "Conflict"
errorMessage: "Request conflicts with present state of resource on server side."
streamId: "d5b2edaa-2c6b-44e1-b794-feea6fa0e15b"
ErrorResponse422:
Comment thread
rlakde marked this conversation as resolved.
Resolved
description: The request is syntactically valid, but its instructions cannot be processed.
Comment thread
rlakde marked this conversation as resolved.
Resolved
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
ErrorResponse429:
description: Indicates request limit breach.
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,13 @@ public class NakshaVersion implements Comparable<NakshaVersion> {
public static final String v2_2_27 = "2.2.27";
public static final String v2_2_28 = "2.2.28";
public static final String v2_2_29 = "2.2.29";
public static final String v2_2_30 = "2.2.30";

/**
* The latest version of the naksha-extension stored in the resources.
*/
@AvailableSince(v2_0_5)
public static final NakshaVersion latest = of(v2_2_29);
public static final NakshaVersion latest = of(v2_2_30);

private final int major;
private final int minor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ public class XyzError extends JsonEnum {
*/
public static final XyzError ILLEGAL_ARGUMENT = defIgnoreCase(XyzError.class, "IllegalArgument");

/**
* The request is syntactically valid, but its instructions cannot be processed.
*
* <p>This will result in a HTTP 422 Unprocessable Entity response.
*/
public static final XyzError UNPROCESSABLE_ENTITY = defIgnoreCase(XyzError.class, "UnprocessableEntity");

/**
* Any service or remote function required to process the request was not reachable.
*
Expand Down
Loading