Skip to content

Regression: failure to validate CBOR in zero-occurrence case (JSON works fine) #148

@itamarst

Description

@itamarst

Consider this schema:

response = {
    "success": bool,
    "data": {* label: [* tstr]}
}
label = tstr

You can have zero labels, which validates fine as JSON:

{"success": true, "data": {}}

Or one label, also validates fine as JSON:

{"success": true, "data": {"hello": ["world"]}}

When generating CBOR with Python's cbor2 for equivalent CBOR serializations, one.cbor validates just fine. zero.cbor fails to validate, however:

[ERROR] Validation of "zero.cbor" failed: error validating at cbor location /"data": map requires entry key of type label

CBOR files are in following zip:

cbor.zip

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions