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.

Better logging for schema issues

See original GitHub issue

Description

When using a large schema, it can be hard to find the specific schema issue from the log warnings. I recently received:

ignoring oneOf in dependencies because there isn’t exactly one subschema that is valid

I know there is an issue with the dependency schema for my form, but unfortunately I have several oneOf dependencies for several refs and I’m having trouble tracking down which one this refers to.

Steps to Reproduce

Create a form with an invalid dependency schema using oneOf

Expected behavior

I’d love to know which schema key this refers to in the console log that outputs when the form knows there is an issue. An external validator tool could be another solution.

Actual behavior

Generic warning in console:

ignoring oneOf in dependencies because there isn’t exactly one subschema that is valid

Version

1.2.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
paintedbicyclecommented, Mar 17, 2019

@epicfaace Ok, you can reference https://github.com/mozilla-services/react-jsonschema-form/pull/1224

I tried to do a very small change here, but it might be beneficial to update other warnings around the lib. But I don’t know the code well enough.

1reaction
paintedbicyclecommented, Mar 17, 2019

Hi @epicfaace I’m sure there are other examples, but the exact one I came up against was this

Inside the the person ref, I simply changed:

              "properties": {
                "Do you have any pets?": {
                  "enum": [
                    "Yes: More than one"
                  ]
                },

to

              "properties": {
                "Do your have any pets?": {
                  "enum": [
                    "Yes: More than one"
                  ]
                },

Note the typo your in only one of the property definitions. So there is a mismatch.

If you open the console, you’ll see:

ignoring oneOf in dependencies because there isn’t exactly one subschema that is valid

Now, in my case, there were many of these anyOf properties. And I would have liked the warning message to simply tell me which one it was.

For example:

ignoring Do you have any pets? oneOf dependency because subschema is not valid

Read more comments on GitHub >

github_iconTop Results From Across the Web

Better logging for schema issues #1188 - GitHub
Just better errorHandling in general would be good. I'm working on a live form builder. Existing formSchema is loaded into a json editor...
Read more >
JSON Logging: 7 Must-Know Tips - Atatus
Tips for the Most Effective JSON logging · #1 Verify your JSON · #2 Make a Standardised Schema · #3 Make Your JSON...
Read more >
30 best practices for logging at scale | Loggly
Offer a standard logging configuration for all teams. Avoid chaos as the company grows.
Read more >
Logging Schema — v2.2.2 - GitHub Pages
This schema for logging documents specifies the information returned by DataONE when requests for logs have been made from either Coordinating Nodes or ......
Read more >
Fast and Reliable Schema-Agnostic Log Analytics Platform
Log schema: Our logs are semi-structured. ES (Elasticsearch) infers schemas automatically, keeps it consistent across the cluster, and enforces ...
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