aws-sdk-android icon indicating copy to clipboard operation
aws-sdk-android copied to clipboard

GetRetainedMessageResult getPayload documentation says that it returns a byte buffer that is base64 encoded, but it is in fact not

Open Meantub opened this issue 1 year ago • 1 comments

GetRetainedMessageResult.getPayload's Javadoc says that it is a base64 encoded byte buffer but there is a ByteBufferJsonUnmarshaller which in it's implementation decodes the incoming base64 byte buffer and returns the decoded byte buffer.

https://github.com/aws-amplify/aws-sdk-android/blob/225234b3f75a26ce50613ee2f7b46e0508000f28/aws-android-sdk-iot/src/main/java/com/amazonaws/services/iotdata/model/GetRetainedMessageResult.java#L103C1-L114C6

Wasn't sure if the link above would render correctly so here is the code I am talking about

    /**
     * <p>
     * The Base64-encoded message payload of the retained message body.
     * </p>
     *
     * @return <p>
     *         The Base64-encoded message payload of the retained message body.
     *         </p>
     */
    public java.nio.ByteBuffer getPayload() {
        return payload;
    }

I think either modifying the documentation to reflect that this isn't a Base64 encoded buffer would work or perhaps creating and using a Base64EncodedByteBufferJsonUnmarshaller if we want the documentation to be the same as it is currently.

Meantub avatar Dec 17 '24 21:12 Meantub

The documentation is just codegenerated and matches what is provided in this link: https://docs.aws.amazon.com/iot/latest/apireference/API_iotdata_GetRetainedMessage.html#API_iotdata_GetRetainedMessage_ResponseSyntax

Will take a further look to see if we can do anything about this.

tylerjroach avatar Dec 17 '24 21:12 tylerjroach