cloudevents / cloudevents/sdk-java

Validation error due to specVersion instead of specversion in the event payload

Open
#487 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-user-input
Dominant language
Java
Stars
446
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Versions:

	implementation group: 'io.cloudevents', name: 'cloudevents-spring', version: '2.4.0'
	implementation 'io.cloudevents:cloudevents-json-jackson:2.4.0'
	implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4'

Example payload:
{"data":{"value":"AN_EXAMPLE_JSON_PAYLOAD","id":"228ad7d1-dd16-4fd5-a02e-4b4bdcb7eaed","source":"service-test","type":"dummy.event","subject":null,"time":null,"specVersion":"V1","dataContentType":"application/cloudevents+json","dataSchema":null,"extensionNames":[],"attributeNames":["datacontenttype","specversion","id","source","type"]}

Getting following error:

org.springframework.messaging.MessageHandlingException: error occurred in message handler [bean 'serviceActivator.handler' for component 'serviceActivator']; nested exception is io.cloudevents.core.format.EventDeserializationException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Missing mandatory specversion attribute

I am not sure if this is a known issue of if there is anything missing in the documentation to properly serialize the base event attributes.
Would appreciate any help here.

Regards,
Giriraj

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported deserialization failure using the example event payload and the listed CloudEvents Spring and Jackson dependencies. Trace how the JSON serializer emits the base attributes versus how deserialization looks up specversion; done when the payload round-trips without the missing mandatory attribute error and a regression test covers the spelling.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.