glTF icon indicating copy to clipboard operation
glTF copied to clipboard

Types of properties in 'extensions' in the property reference

Open javagl opened this issue 2 years ago • 3 comments

The mesh.primitive.attributes schema declares

            "additionalProperties": {
                "$ref": "glTFid.schema.json"
            }

and the mesh.primitive.attributes property reference shows this as

Type of each property: integer

In contrast to that, the extension schema declares

    "additionalProperties": {
        "type": "object"
    }

and the property reference for this - which is inlined into all property references, for example, the mesh.primitive.extensions property reference - shows this as

Type of each property: Extension

Shouldn't this "type of each property" be object instead?

(This came up via https://github.com/CesiumGS/wetzel/pull/68#discussion_r824755241 )

javagl avatar May 14 '22 16:05 javagl

Shouldn't this "type of each property" be object instead?

Good catch. Yes, members of the extensions object should be of object type (as Extension is not a JSON-Schema type at all).

lexaknyazev avatar May 14 '22 16:05 lexaknyazev

One could argue about the term "JSON-Schema type" here, and rather say that in the first case, the text should say

Type of each property: glTFid

but with the caveat that glTFid does not appear in the property reference, but only in the schema reference. (It is listed as one of the "ignored types" when creating the property reference).

Or to put it that way: Iff there was a structure with

"additionalProperties": {
    "$ref": "buffer.schema.json"
}

then it should not say object, but a link to buffer at this point. At least, I think that the current output is indeed the result of an attempt to exactly do this sort of cross-linking between types. (IIRC, there is no case where this is relevant for glTF - here, it will always be object in these cases - but I'm trying to get a better understanding for wetzel right now...)

javagl avatar May 14 '22 16:05 javagl

@lexaknyazev You had assigned that to yourself - not sure whether that was intentional - but it should be addressed (together with https://github.com/KhronosGroup/glTF/issues/2165 ) in https://github.com/CesiumGS/wetzel/pull/88 .

javagl avatar Oct 10 '23 14:10 javagl