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.

Consider forcing end-users into explicitly selecting a format behavior once Draft 8 is out

See original GitHub issue

See the discussion in #403 – it might be worthwhile (i.e. it might remove some footgunning) to force even users who do not want format to do anything to have to opt into that by passing in an empty FormatChecker.

Let’s wait here though until Draft 8 is out, since one of its focuses is to further classify things in a way that makes these things generally applicable.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Juliancommented, Jul 26, 2022

There’s a note about this in the FAQ which I’ve updated (quite awhile ago now).

@LukeMarlin and others I agree with most of the feedback here – in newer drafts the way to be more explicit is $vocabulary, though support there is still in-progress (I do hope it’ll fully land soon, working on it alongside a few other things).

I think the feedback about Understanding JSON Schema is likely good too, do take it upstream.

For now though I don’t see much more to do here locally in the library, so going to close for now beyond getting $vocabulary fully working. Of course additional feedback is always welcome.

0reactions
LukeMarlincommented, Mar 7, 2019

Hey, end-user here 😃

As you both rightfully said, not everyone goes deep in the spec. I read http://json-schema.org/understanding-json-schema/reference/string.html#format and nothing seemed fishy. After reading the thread, I now noticed that there is a small friendly blue note saying “that’s not required”. Honestly, I completely skipped it and went straight to what the spec offers. I was really please to see ipv4 format and tried to use it with your lib.

When I noticed that “bob” was considered OK, I went through some syntax checking, spell checking, checks on other tools (that DO implement it by default: https://www.jsonschemavalidator.net/) and was really confused. That’s when/why I ended up here, checking if someone reported the issue.

Things I would have liked:

  • In the “understanding jsonschema”, this should be a Warning, not a note. If one doesn’t try a wrong value, one might have relayed on an ignored check on production (that’s not on your side)
  • Maybe an info about this on your readme. It is quite small and I would have seen it without doubt (except if it’s just a small note in blue 😄)
  • A warn that would hint me: “I’ve noticed your schema has format, be aware that I don’t support this”
  • Being forced to be explicit about the behaviour I need.

There’s many ways one can avoid to be in this case (thorough read of docs, unit tests with failing cases), but people make mistakes. A crash is problematic, a silent validation of a wrong data is potentially catastrophic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Final Rule: Selective Disclosure and Insider Trading - SEC.gov
SUMMARY: The Securities and Exchange Commission is adopting new rules to address three issues: the selective disclosure by issuers of material nonpublic ...
Read more >
Fair Lending Laws and Regulations - FDIC
The existence of illegal disparate treatment may be established either by statements revealing that a lender explicitly considered prohibited factors (overt ...
Read more >
Ethical Decision Making and Behavior - SAGE Publishing
This chapter surveys the components of ethical behavior—moral sensitivity, moral judgment, moral motivation, and moral character—and introduces.
Read more >
Insights on New California Privacy Law Draft Regulations
Our lawyers provide insights into the draft regulations created by the California Privacy Protection Agency for the California Privacy ...
Read more >
Third-Party Relationships: Risk Management Guidance | OCC
A bank should conduct due diligence on all potential third parties before selecting and entering into contracts or relationships.
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