Skip to content

Change request with empty embedded object fails

Summary

With the change introduced by the issue #203, it's not possible to create a change request with an empty embedded object.

Description

When a user posts a change request to add an empty embedded object to a logistics object, NE:ONE classifies it as a LO and does not assign an internal id

Steps to Reproduce (for bugs)

  1. Create a logistics object
  2. PATCH the logistics object with the following payload
{
    "@context": {
        "cargo": "https://onerecord.iata.org/ns/cargo#",
        "api": "https://onerecord.iata.org/ns/api#"
    },
    "@type": "api:Change",
    "api:hasLogisticsObject": {
        "@id": "YOUR LOGISTICS OBJECT URL"
    },
    "api:hasDescription": "Add grossWeight",
    "api:hasOperation": [
        {
            "@type": "api:Operation",
            "api:op": {
                "@id": "api:ADD"
            },
            "api:s": "YOUR LOGISTICS OBJECT URL",
            "api:p": "https://onerecord.iata.org/ns/cargo#grossWeight",
            "api:o": [
                {
                    "@type": "api:OperationObject",
                    "api:hasDatatype": "https://onerecord.iata.org/ns/cargo#Value",
                    "api:hasValue": "_:b0"
                }
            ]
        }
    ],
    "api:hasRevision": {
        "@type": "http://www.w3.org/2001/XMLSchema#positiveInteger",
        "@value": "1"
    }
}

Expected Behavior

Create an embedded object with an internal ID. In the previous example, create an embedded object of a value.

Actual Behavior

NE:ONE considers the embedded object as a logistics object.