org.mule.module.apikit.exception.BadRequestException: instance type (integer) does not match any allowed primitive type (allowed: ["string"])

MuleSoft JIRA | Stefan Cordes | 4 months ago
  1. 0

    Without debugging it is impossible to see what is the error message during json schema validation when there are some warnings inside. Current Result is correct {noformat} com.github.fge.jsonschema.core.report.ListProcessingReport: failure --- BEGIN MESSAGES --- warning: format attribute "yyyy-MM-dd" not supported level: "warning" schema: {"loadingURI":"file:/C:/java/mule/.mule/apps/cara-system/classes/includes/season-schema.json#","pointer":"/properties/beginDate"} domain: "validation" keyword: "format" attribute: "yyyy-MM-dd" error: instance type (null) does not match any allowed primitive type (allowed: ["string"]) level: "error" schema: {"loadingURI":"file:/C:/java/mule/.mule/apps/cara-system/classes/includes/season-schema.json#","pointer":"/properties/customerGroup"} instance: {"pointer":"/customerGroup"} domain: "validation" keyword: "type" found: "null" expected: ["string"] warning: format attribute "yyyy-MM-dd" not supported level: "warning" schema: {"loadingURI":"file:/C:/java/mule/.mule/apps/cara-system/classes/includes/season-schema.json#","pointer":"/properties/endDate"} domain: "validation" keyword: "format" attribute: "yyyy-MM-dd" --- END MESSAGES --- {noformat} But BadRequestException just shows: {noformat} Root Exception stack trace: org.mule.module.apikit.exception.BadRequestException: warning: format attribute "yyyy-MM-dd" not supported level: "warning" schema: {"loadingURI":"file:/C:/mule-enterprise-standalone-3.8.2/apps/cara-system-deve/classes/includes/season-schema.json#","pointer":"/properties/beginDate"} domain: "validation" keyword: "format" attribute: "yyyy-MM-dd" at org.mule.module.apikit.validation.RestJsonSchemaValidator.validate(RestJsonSchemaValidator.java:104) {noformat} The information {noformat} error: instance type (null) does not match any allowed primitive type (allowed: ["string"]) is dropped as only first message is taken. {noformat}

    MuleSoft JIRA | 2 months ago | Stefan Cordes
    org.mule.module.apikit.exception.BadRequestException: warning: format attribute "yyyy-MM-dd" not supported level: "warning" schema: {"loadingURI":"file:/C:/mule-enterprise-standalone-3.8.2/apps/cara-system-deve/classes/includes/season-schema.json#","pointer":"/properties/beginDate"} domain: "validation" keyword: "format" attribute: "yyyy-MM-dd"

    Root Cause Analysis

    1. org.mule.module.apikit.exception.BadRequestException

      instance type (integer) does not match any allowed primitive type (allowed: ["string"])

      at org.mule.module.apikit.validation.RestJsonSchemaValidator.validate()
    2. org.mule.module
      RestJsonSchemaValidator.validate
      1. org.mule.module.apikit.validation.RestJsonSchemaValidator.validate(RestJsonSchemaValidator.java:86)
      1 frame