镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Read object for fixext broken by design #269

Open

Description

@stalkerg

Hello.
Currently, I try to read fixext like a MessagePackObject, but it's not possible.

  1. fixext read as Binary (MessagePackObject<byte[]>) instead MessagePackObject<MessagePackExtendedTypeObject>. Some extra proves I found here https://github.com/msgpack/msgpack-cli/wiki/New-message-pack-spec .
  2. I can't convert to Bytes[] by AsBinary because you check string here:
An exception of type 'System.ArgumentException' occurred in MsgPack.dll but was not handled in user code: 'Do not convert System.Byte[] MessagePackObject to MsgPack.MessagePackString.'
   at MsgPack.MessagePackObject.VerifyUnderlyingType[T](MessagePackObject instance, String parameterName)

What should I do for reading objects from a stream and just check the object for fixext? (in my stream I also have other types)

Activity

  1. added
    bugDetected as bug
    need-more-infoNeed more information (error message, stack trace, repro code etc)
    on Nov 5, 2017
  2. yfakariya commented on Nov 5, 2017

    @yfakariya
    Member

    Thank you for feedback.

    1. Why do you use it so? Could you tell me a your use case or scenario?
    2. It is bug for type check. The message should be like `Do not convert MsgPack.MessagePackExtendedTypeObject MessagePackObject to Byte[].'
  3. stalkerg commented on Nov 5, 2017

    @stalkerg
    Author

    Thanks for answers.

    1. I should implement custom serializer over "msgpack-cli" because I have already specific lib/service in another language.
    2. Ok, it's logical but how I can recognize that is current object MessagePackExtendedTypeObject?
  4. yfakariya commented on Nov 5, 2017

    @yfakariya
    Member

    You can use MessagePackObject.IsTypeOf<MessagePackExtendedTypeObject>(). Do you use this method to implement your custom serializer?

  5. stalkerg commented on Nov 6, 2017

    @stalkerg
    Author

    You can use MessagePackObject.IsTypeOf()

    Ohh thanks! I just skip it because I expected what

    MessagePackObject.UnderlyingType == typeof(MessagePackExtendedTypeObject)
    

    should be same as

    MessagePackObject.IsTypeOf<MessagePackExtendedTypeObject>()
    
  6. stalkerg commented on Nov 6, 2017

    @stalkerg
    Author

    I confirm IsTypeOf for MessagePackExtendedTypeObject is work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDetected as bugneed-more-infoNeed more information (error message, stack trace, repro code etc)question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions