Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/lib/serviceRoutines/getEntities.c
Original file line number Diff line number Diff line change
Expand Up @@ -1629,7 +1629,7 @@ bool getEntities(void)
}
if (corNgsild.orderGeometry != NULL && strcmp(corNgsild.orderGeometry, "Point") != 0)
{
ldError(501, LD_ERROR_OP_NOT_SUPPORTED, "Not Implemented",
ldError(422, LD_ERROR_OP_NOT_SUPPORTED, "Operation Not Supported",
"sort by distance is only supported for a Point orderGeometry (got '%s')", corNgsild.orderGeometry);
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/serviceRoutines/getEntitiesTemporal.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ bool getEntitiesTemporal(void)
//
if (filter.qSqlPredicate == NULL)
{
ldError(501, LD_ERROR_OP_NOT_SUPPORTED, "Operation Not Supported",
ldError(422, LD_ERROR_OP_NOT_SUPPORTED, "Operation Not Supported",
"this 'q' cannot be evaluated against the temporal store");
return true;
}
Expand Down
13 changes: 9 additions & 4 deletions src/lib/troe/troeNotAvailable.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,21 @@ void troeNotAvailable(const char* op)
// Two flavors:
// - no TRoE wired in at all (alias is NULL or "none") → "started without TRoE support"
// - a real plugin is active but doesn't implement this op → "plugin doesn't support op"
// 501 in either case: from the client's view the operation is not implemented
// by this server build/configuration.
// 422 in either case. From the client's view this IS "not implemented by this
// build", which reads like 501 - but TS 104-176 § 6.3.2 maps each error type to
// one status, and OperationNotSupported is 422. The only 501 in that table is
// NoMultiTenantSupport, a type reserved for one specific capability, so there
// is nothing registered that says "this deployment lacks an optional
// component" in general. See spec-doubts-2 #124; until it moves, the detail
// carries what the status cannot.
if (strcmp(alias, "none") == 0)
{
ldError(501, LD_ERROR_OP_NOT_SUPPORTED, "TRoE Not Available",
ldError(422, LD_ERROR_OP_NOT_SUPPORTED, "TRoE Not Available",
"broker started without TRoE support; '%s' requires a TRoE plugin", op);
}
else
{
ldError(501, LD_ERROR_OP_NOT_SUPPORTED, "TRoE Not Available",
ldError(422, LD_ERROR_OP_NOT_SUPPORTED, "TRoE Not Available",
"TRoE plugin '%s' does not implement '%s'", alias, op);
}
}
8 changes: 4 additions & 4 deletions test/funcTests/cases/geo_orderby_distance.test
Original file line number Diff line number Diff line change
Expand Up @@ -289,15 +289,15 @@ Content-Length: 189

07. dist-asc with a non-Point orderGeometry — 501 Not Implemented
=================================================================
HTTP/1.1 501 Not Implemented
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Content-Type: application/json
Content-Length: 216
Content-Length: 224

{
"detail": "sort by distance is only supported for a Point orderGeometry (got 'LineString')",
"status": 501,
"title": "Not Implemented",
"status": 422,
"title": "Operation Not Supported",
"type": "https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported"
}

Expand Down
8 changes: 4 additions & 4 deletions test/funcTests/cases/geo_orderby_distance_corDB.test
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,15 @@ Content-Length: 189

07. dist-asc with a non-Point orderGeometry — 501 Not Implemented
=================================================================
HTTP/1.1 501 Not Implemented
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Content-Type: application/json
Content-Length: 216
Content-Length: 224

{
"detail": "sort by distance is only supported for a Point orderGeometry (got 'LineString')",
"status": 501,
"title": "Not Implemented",
"status": 422,
"title": "Operation Not Supported",
"type": "https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported"
}

Expand Down
8 changes: 4 additions & 4 deletions test/funcTests/cases/local_param_distops_suppress.test
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ Content-Length: 152

08. GET /temporal/entities/urn:S1 — accepted (plugin layer 501 is fine)
=======================================================================
HTTP/1.1 501 Not Implemented
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Content-Type: application/json
Content-Length: REGEX(\d+)

{
"detail": "TRoE plugin 'ramdb' does not implement 'temporal-entity retrieve'",
"status": 501,
"status": 422,
"title": "TRoE Not Available",
"type": "https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported"
}
Expand All @@ -220,14 +220,14 @@ Content-Length: REGEX(\d+)

09. GET /temporal/entities/urn:S1?local=true — accepted at API surface (regression: was 400)
=============================================================================================
HTTP/1.1 501 Not Implemented
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Content-Type: application/json
Content-Length: REGEX(\d+)

{
"detail": "TRoE plugin 'ramdb' does not implement 'temporal-entity retrieve'",
"status": 501,
"status": 422,
"title": "TRoE Not Available",
"type": "https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported"
}
Expand Down
4 changes: 2 additions & 2 deletions test/funcTests/cases/temporal_create_errors.test
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ Content-Length: 182

04. valid URI but no TRoE plugin → 501 Not Implemented
=======================================================
HTTP/1.1 501 Not Implemented
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Content-Type: application/json
Content-Length: 224

{
"detail": "broker started without TRoE support; 'temporal-entity create' requires a TRoE plugin",
"status": 501,
"status": 422,
"title": "TRoE Not Available",
"type": "https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#
# FILE troe_disabled_temporal_501.test
# FILE troe_disabled_temporal_not_supported.test
#
# AUTHOR Ken Zangelin
#
# Copyright 2026 Seamware
#
# § 6.18 — a broker started without TRoE support has no temporal storage; a
# temporal-entity retrieve must be refused with 501 (Operation Not Supported),
# temporal-entity retrieve must be refused with 422 (Operation Not Supported),
# not attempted. The broker here runs with the default TRoE (none).
#
--NAME--
GET /temporal/entities with TRoE disabled → 501 Operation Not Supported
GET /temporal/entities with TRoE disabled → 422 Operation Not Supported

--TAGS--
troe temporal
Expand All @@ -21,24 +21,24 @@ coraineStart

--RUN--

echo "01. GET /temporal/entities/{id} — 501 (no TRoE backend)"
echo "01. GET /temporal/entities/{id} — 422 (no TRoE backend)"
echo "======================================================="
corCurl --url /ngsi-ld/v1/temporal/entities/urn:ngsi-ld:T:1
echo
echo


--EXPECT--
01. GET /temporal/entities/{id} — 501 (no TRoE backend)
01. GET /temporal/entities/{id} — 422 (no TRoE backend)
=======================================================
HTTP/1.1 501 Not Implemented
HTTP/1.1 422 Unprocessable Content
Date: REGEX(.*)
Content-Type: application/json
Content-Length: 226

{
"detail": "broker started without TRoE support; 'temporal-entity retrieve' requires a TRoE plugin",
"status": 501,
"status": 422,
"title": "TRoE Not Available",
"type": "https://uri.etsi.org/ngsi-ld/errors/OperationNotSupported"
}
Expand Down
Loading