-
Notifications
You must be signed in to change notification settings - Fork 69
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Zilla instance crashes when invalid event like { "test": "test" } is sent to schema validation enabled endpoint.
To Reproduce
Steps to reproduce the behavior:
- Go to openapi.proxy example
- Update Pet Schema with mentioned field:
Pet:
type: object
required:
- eventType
- eventTime
- eventId
- event
- Start the example using
./setup.sh - Trigger mentioned request:
curl -i -X POST http://localhost:7114/pets \
-H "Content-Type: application/json" \
-d '{ "test": "test" }'
- Zilla crashes with mentioned exception:
org.agrona.concurrent.AgentTerminationException: java.lang.IllegalArgumentException: length=265 is beyond maximum length=254
at [email protected]/io.aklivity.zilla.runtime.engine.internal.registry.EngineWorker.doWork(EngineWorker.java:858)
at org.agrona.core/org.agrona.concurrent.AgentRunner.doWork(AgentRunner.java:304)
at org.agrona.core/org.agrona.concurrent.AgentRunner.workLoop(AgentRunner.java:296)
at org.agrona.core/org.agrona.concurrent.AgentRunner.run(AgentRunner.java:162)
at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.lang.IllegalArgumentException: length=265 is beyond maximum length=254
at [email protected]/io.aklivity.zilla.runtime.model.json.internal.types.String8FW$Builder.checkLength(String8FW.java:163)
at [email protected]/io.aklivity.zilla.runtime.model.json.internal.types.String8FW$Builder.set(String8FW.java:148)
at [email protected]/io.aklivity.zilla.runtime.model.json.internal.types.event.JsonModelValidationFailedExFW$Builder.error(JsonModelValidationFailedExFW.java:117)
...
stopped
Expected behavior
Validation should work as expected & we should observe mentioned validation failure event in log for given request.
zilla-openapi-proxy:north_openapi_server [04/Feb/2025:15:03:10 +0000] MODEL_JSON_VALIDATION_FAILED A message payload failed validation. [1,18][] The object must have a property whose name is "eventType".
[1,18][] The object must have a property whose name is "eventTime".
[1,18][] The object must have a property whose name is "eventId".
[1,18][] The object must have a property whose name is "event".
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working