smithy-lang / smithy

Smithy is a protocol-agnostic interface definition language and set of tools for generating clients, servers, and documentation for any programming language.
https://smithy.io
Apache License 2.0
1.7k stars 201 forks source link

Lack of coverage in RPC v2 CBOR protocol test suite #2325

Open david-perez opened 2 weeks ago

david-perez commented 2 weeks ago

I'll use this issue to track lack of coverage in the RPC v2 CBOR protocol test suite: https://github.com/smithy-lang/smithy/tree/main/smithy-protocol-tests/model/rpcv2Cbor; I'll update the issue description as I find issues when finishing my implementation.

mullermp commented 1 week ago

Should there be a test similar to "RpcV2CborDeserializesDenseSetMapAndSkipsNull" for lists?

drganjoo commented 5 days ago

Ignore unknown members

We have the following tests to check servers and clients ignore unknown members:

For clients:RpcV2CborExtraFieldsInTheBodyShouldBeSkippedByClients

{_
    "byteValue": 5,
    "doubleValue": 1.889_3,
    "falseBooleanValue": false,
    "floatValue": 7.625_2,
    "extraObject": {_
        "indefiniteLengthMap": {_ "withAnArray": [_ 1, 2, 3]},
        "definiteLengthMap": {
            "withADefiniteArray": [1, 2, 3],
            "andSomeIndefiniteLengthString": "that has, been chunked on comma",
            "normalString": "foo",
        },
        "shortValue": 9999_1,
        "someOtherField": "this should be skipped",
    },
    "integerValue": 256_1,
    "longValue": 9873_1,
    "shortValue": 9898_1,
    "stringValue": "simple",
    "trueBooleanValue": true,
    "blobValue": h'666f6f',
}

For servers: RpcV2CborExtraFieldsInTheBodyShouldBeSkippedByServers:

{_
    "byteValue": 5,
    "doubleValue": 1.889_3,
    "falseBooleanValue": false,
    "floatValue": 7.625_2,
    "extraObject": {_
        "indefiniteLengthMap": {_ "withAnArray": [_ 1, 2, 3]},
        "definiteLengthMap": {
            "withADefiniteArray": [1, 2, 3],
            "andSomeIndefiniteLengthString": "that has, been chunked on comma",
            "normalString": "foo",
        },
        "shortValue": 9999_1,
        "someOtherField": "this should be skipped",
    },
    "integerValue": 256_1,
    "longValue": 9873_1,
    "shortValue": 9898_1,
    "stringValue": "simple",
    "trueBooleanValue": true,
    "blobValue": h'666f6f',
}