opencontainers / runtime-spec

OCI Runtime Specification
http://www.opencontainers.org
Apache License 2.0
3.19k stars 541 forks source link

runtime.md: State MUST be serialized with specific indentation pattern? #1177

Closed AkihiroSuda closed 1 year ago

AkihiroSuda commented 1 year ago

When serialized in JSON, the format MUST adhere to the following pattern:

{
    "ociVersion": "0.2.0",
    "id": "oci-container1",
    "status": "running",
    "pid": 4422,
    "bundle": "/containers/redis",
    "annotations": {
        "myKey": "myValue"
    }
}

https://github.com/opencontainers/runtime-spec/blob/v1.0.2/runtime.md#state

Does the above sentence demands that a state JSON "MUST" adhere to the specific indentation pattern? I assume not, but what does "the following pattern" mean then?

duglin commented 1 year ago

No indentation does not matter. It's just referring to the things like the name, case and nesting of the attributes. For example, using ID instead of id would not be valid.

AkihiroSuda commented 1 year ago

Thanks, opened #1178 for avoidance of confusion

tianon commented 1 year ago

Agreed, I think "schema" is probably closer to the original intent here than literally this pattern (which could mean all the whitespace and the field order, since JSON is technically an ordered document, and that seems like a pretty unreasonable restriction IMO).