Skip to content

Can property names have annotations? #772

Closed
@jdesrosiers

Description

@jdesrosiers

In the new annotation test suite, we have the following test.

{
"description": "`propertyNames`",
"compatibility": "6",
"schema": {
"propertyNames": {
"const": "foo",
"title": "Foo"
}
},
"tests": [
{
"instance": {
"foo": 42
},
"assertions": [
{
"location": "/foo",
"keyword": "title",
"expected": {}
}
]
}
]
},

However, it's not entirely clear whether property names can have annotations. The reason being that a JSON Pointer can't point to a property name. The pointer in this test technically points to the property value, not the property name.

Implementations could just use the standard pointer and users/tooling just need to know that it's a special case, but special cases make programmatic use of annotations problematic and implementations might choose to avoid that. Implementations could choose also use a custom pointer syntax or flag to indicate that the pointer points to the property name, but that wouldn't be interoperable.

Since there's no interoperable and accepted solution to this problem, I suggest we remove this test. That would mean the test suite would be ambiguous about whether property names can have annotations or how they are implemented if they do.

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions