question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

errors not work in anyOf

See original GitHub issue

General information

  • json-editor version: 1.4 & 2.0 /* all */

Expected behavior

when error occur the editor can show error message.

Actual behavior

It doesn’t show error message in anyOf array.

Steps to reproduce the behavior

Direct link to example: https://is.gd/FM9u4L

labelComponent doesn’t work.

{
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_]+$",
      "minLength": 1,
      "maxLength": 50
    },
    "children": {
      "items": {
        "type": "object",
        "anyOf": [
          {
            "$ref": "#/definitions/labelComponent"
          }
        ]
      },
      "type": "array"
    }
  },
  "type": "object",
  "defaultProperties": [
    "id",
    "children"
  ],
  "definitions": {
    "labelComponent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[a-zA-Z0-9_]+$",
          "minLength": 1,
          "maxLength": 50
        }
      },
      "defaultProperties": [
        "id"
      ]
    }
  }
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:27 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Radouchcommented, Sep 29, 2020

I am probably missing something. If I open the original link https://is.gd/FM9u4L , it still does not work as expected: there is only “high-level” error “Value must validate against at least one of the provided schemas”, but no errors inside anyOf are displayed. The same behavior is in my local installation of this editor (by npm).

How can errors inside anyOf options be displayed?

1reaction
wclssdncommented, Oct 22, 2019

@pmk65 Yes i think so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

anyOf validation errors only present when other validations fail
I'm expecting an errors object containing only the failed minLength failure as changing name to a string with length > 0 causes the...
Read more >
Error Json Validation against JsonSchema and anyOf [closed]
I have a json to validate against jsonSchema, I don't understand why i have an error with the first anyOf, indeed, we can...
Read more >
oneOf, anyOf, allOf, not - Swagger
Use the oneOf keyword to ensure the given data is valid against one of the specified schemas. ... The example above shows how...
Read more >
How to correct a #DIV/0! error - Microsoft Support
To correct the error, do any of the following: Make sure the divisor in the function or formula isn't zero or a blank...
Read more >
Error in Sieve Filter: Function anyof called with too many ...
It was verified that this error is not syntax related; if the problem line from the rule is removed, the next last line...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found