Pierangelo Di Pilato

Results 472 comments of Pierangelo Di Pilato

> ```cs > Data = "{\"Hello\": \"there\"}", > ``` is this a JSON string? isn't a JSON string something like `Data = "\"{\"Hello\": \"there\"}\""` as per https://www.rfc-editor.org/rfc/rfc8259#section-7? (I mean as...

I tried with java SDK for some examples you have showed here (no HTTP _deserialization_): ```java final CloudEvent[] events = new CloudEvent[]{ CloudEventBuilder.v1() .withId(UUID.randomUUID().toString()) .withType("foo") .withSource(URI.create("/foo")) .withData("application/json", "\"{\"Hello\": \"there\"}\"".getBytes(StandardCharsets.UTF_8)) .build(),...

I'm not sure what's more wrong but to me the fact that Java SDK serialize to invalid JSON is wrong, however, for the `{[[[}` case, I'd expect to have `data_base64`...

Ok, I see, Java SDK represents data only as bytes (byte[]), so `withData` accepts only bytes and therefore there isn't really a possibility for misinterpretation (aka you pass x, you...

Not only people, even things like proto text data to JSON format, the Java SKD loses the quotes: ```java io.cloudevents.v1.proto.CloudEvent protoCe = io.cloudevents.v1.proto.CloudEvent .newBuilder() .setSpecVersion("1.0") .setId(UUID.randomUUID().toString()) .setType("foo") .setSource("/foo") .setTextData("hello") .build();...

https://www.javadoc.io/doc/io.cloudevents/cloudevents-api/latest/index.html :')

@JemDay, I'm matching the implementation. This part ```java io.cloudevents.v1.proto.CloudEvent protoCe = io.cloudevents.v1.proto.CloudEvent .newBuilder() .setSpecVersion("1.0") .setId(UUID.randomUUID().toString()) .setType("foo") .setSource("/foo") .setTextData("hello") .build(); CloudEvent ce = new ProtoDeserializer(protoCe).read(CloudEventBuilder::fromSpecVersion); ``` is equivalent to: https://github.com/cloudevents/sdk-java/blob/4ebeab0e0ff8d0c507c47b32dd7ec2da95dc87cb/formats/protobuf/src/main/java/io/cloudevents/protobuf/ProtobufFormat.java#L61-L69 ```java...

> Apologies for the delay, I've been hut-of-town and I'm trying to keep up on this thread... > > HTTP is a red-herring, we should be concentrating on the 'format'...

Right, you're not wrong, we need something like StringCloudEventData object that is instantiated by protobuf when `text_data` is used and properly handled by other formats (JSON being one of them)