BadRequestData
Andromeda answers 400 with the problem type https://uri.etsi.org/ngsi-ld/errors/BadRequestData. The request parses, but it holds a value the specification doesn't allow. Every rule in Strictness raises BadRequestData unless the rule names another type, which makes this the type you will see most. The specification defines this type and binds it to 400.
When this comes back
These are the common causes. In each one, the detail names the member and the rule.
- A
DateTimewritten with+00:00instead ofZ, or with a seventh fractional digit. See Date-times. - A
unitCodethat isn't a UN/CEFACT common code, or is lowercase. See Units. - An attribute or type name with a hyphen, a dot or a leading digit, or a reserved name such as
value. That holds in a body and in a query parameter such asattrsalike. See Identifiers and names. - A language tag written
en_USinstead ofen-US. See Language tags. - A Relationship
objectthat is a bare name instead of a URI. See Identifiers and names. - A geometry with a position outside the coordinate ranges, a
GeometryCollection, or an unclosed Polygon ring. See Geometry. - A
qexpression with a syntax error. A well-formedqover a complexity limit isTooComplexQueryinstead. - A query that narrows nothing, with no
type,attrs,q, geoquery oridand nolocal=true. See Query parameters. - A JSON
nullanywhere in a request body. See JSONnull. - The NGSI-LD Null in a whole-payload write, or next to other values in the same member. See The NGSI-LD Null.
- An attribute instance with two value members, a member its attribute type never defines, or a
typethat isn't one of the eight attribute types. See Attributes. - An
@contextbelow the top level of a payload, a scoped context, orapplication/ld+jsonsent together with a contextLinkheader. See JSON-LD@context. - A batch body that isn't an array, is empty, holds a
nullitem, or holds an item whoseidisn't a URI. See Batch operations. - An identifier over 1,024 UTF-8 octets, an attribute nested over 32 levels, or a number outside the range Andromeda stores exactly. These are Andromeda's own bounds, and the
detailgives the limit. - A tenant name outside the tenant grammar, when the write creates the tenant.
- An
NGSILD-Snapshotheader that isn't a URI. - A subscription or registration member of the wrong JSON type, on creation and in an update fragment alike.
In a batch, a fault that belongs to one entity is reported against that entity in a 207 instead, and the rest of the batch is written. Only a fault that sinks the whole request comes back as this error.
Example
A batch delete with a null among its items gets this answer.
POST /ngsi-ld/v1/entityOperations/delete
Content-Type: application/json
[
"urn:ngsi-ld:Building:1",
null
]
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"type": "https://uri.etsi.org/ngsi-ld/errors/BadRequestData",
"title": "Bad request data",
"status": 400,
"detail": "batch item 1 is null",
"instance": "/ngsi-ld/v1/entityOperations/delete"
}
What it is not
An entity a context source returns that would fail a local write isn't reported as this error. It is left out of the answer and reported in an NGSILD-Warning header, and the rest of the page still comes back. See Distributed operations.