Skip to content

Exception on Special Characteres "//" #38

Description

@hebergentilin

I'm getting errors when informing special characteres like '//' (char generated from encoded base64 file) at a proto bytes field.

protos

message InformaContestacaoCliente {
	required Contestacao contestacao = 1;
}

message Contestacao {
	repeated Anexo anexos = 1;
}

message Anexo {
    optional bytes anexo = 2;
}

formatFactory.java

FormatFactory formatFactory = new FormatFactory();
ProtobufFormatter formatter = formatFactory.createFormatter(FormatFactory.Formatter.XML_JAVAX);
InputStream in = TextUtils.toInputStream(paramString);
formatter.merge(in, this.builder);

I got a java.lang.RuntimeException: Can't get here. message exception at XmlJavaxFormat.java:566.

Change the formater, from XML_JAVAX to XML, I got this exception:
com.googlecode.protobuf.format.ProtobufFormatter$ParseException: 4:22: Expected ">".

Request sending:

<ANEXOS>
    <anexos>
        <tipoAnexo>3</tipoAnexo>
        <descricao>foto frontal</descricao>
        <anexo><![CDATA[//]]></anexo>
    </anexos>
</ANEXOS>

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions