lib/agent99/message_processing.rb in agent99-0.0.3 vs lib/agent99/message_processing.rb in agent99-0.0.4
- old
+ new
@@ -126,10 +126,12 @@
# Validates the incoming message against the defined schema.
#
# @return [Array] An array of validation errors, empty if validation succeeds
#
def validate_schema
- schema = JsonSchema.parse!(self.class::REQUEST_SCHEMA)
+ return unless info[:request_schema]
+
+ schema = JsonSchema.parse!(info[:request_schema])
schema.expand_references!
validator = JsonSchema::Validator.new(schema)
validator.validate(@payload)
[]