8000 Incorrect error message for arrays · Issue #78 · everit-org/json-schema · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Incorrect error message for arrays #78
Closed
@drawohkam

Description

@drawohkam

When an array has the "maxItems" set. The validation error message fails to display the maxItems value.

  try
  {
     String schemaString = "{\"type\": \"object\", \"properties\": {\"foo\": {\"type\": \"array\", \"maxItems\": 1, \"items\": {\"type\": \"string\"}}}}";
     Schema schema = SchemaLoader.load(new JSONObject(schemaString));
     schema.validate(new JSONObject("{\"foo\": [\"\", \"\"]}"));
  } catch (ValidationException e)
  {
     System.out.println(e.getMessage());
  }

The error message:

#/foo: expected maximum item count: null, found: 2

The "null" should be 1 in this example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0