Skip to content

Readme #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 19, 2025
Merged

Readme #53

merged 6 commits into from
Aug 19, 2025

Conversation

arpitkuriyal
Copy link
Collaborator

We can add more anyOf cases once all cases will complete, and can add more example if you think if missing and can correct or include anything if missed.

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the README is the right place to document the details of things like the cases anyOf handles. I'd expect that to be a separate document that the README links to.

@arpitkuriyal
Copy link
Collaborator Author

arpitkuriyal commented Aug 18, 2025

should i make a separate readme file in the errorhandlers folder and link it with this readme file for explaination how we handle cases like anyOf or should make a separate docs folder in the project?

@jdesrosiers
Copy link
Collaborator

I was thinking I was thinking something more like a docs folder at the top level.

Copy link
Collaborator

@jdesrosiers jdesrosiers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple more small things to fix, then this is a good enough start.

A few more things I'd like to see in the next PR:

  • Document the discriminator handling for anyOf
  • Document the const/enum handling for anyOf
  • Add examples for supporting custom keywords and error handlers
  • Mention that we can reduce multiple instances of a keyword to a single message. (Example: "allOf": [{ "minimum": 3 }, { "minimum": 5 }] only produces one message instead of one for each.
  • A separate documentation file (like anyOf.md) for any error handler that does something interesting like reduce multiple keywords into one message. Not every error handler needs a file, just the interesting ones.

.gitignore Outdated
@@ -1,6 +1,6 @@
node_modules/

docs/

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, we can't put it in the docs folder because that's where typedoc generates its thing for the website. You'll need to come up with a different name. Maybe just documentation.

README.md Outdated
## API Error Message Format

Our API Error Format includes :-
- **`schemaLocation`** - A JSON URI that points to the specific keyword(s) within the schema that failed validation. This can be a single string or an array of absolute keyword locations for errors that are grouped together.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A JSON URI isn't a thing. Maybe, "A URI with a JSON Pointer", or just "A URI" works too.

README.md Outdated

TODO: Write some examples
The library uses [fluent](https://projectfluent.org) `.ftl` files provide localized error messages. By default, only English is supported.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The library uses [fluent](https://projectfluent.org) `.ftl` files provide localized error messages. By default, only English is supported.
The library uses [fluent](https://projectfluent.org) `.ftl` files to provide localized error messages. By default, only English is supported.

README.md Outdated
Sometimes a single validation issue is tied to **more than one schema keyword**.
For example, when both `minimum` and `exclusiveMinimum` apply, or when `minLength` and `maxLength` constraints overlap or when when both `minimum` and `maximum` apply.

Instead of generating duplicate error messages, It groups these into an **array of schema locations** and produces one concise, human-friendly message :-
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They aren't really duplicate messages, right? How about,

Suggested change
Instead of generating duplicate error messages, It groups these into an **array of schema locations** and produces one concise, human-friendly message :-
Instead of multiple related error messages, It groups these into an **array of schema locations** and produces one concise, human-friendly message :-

README.md Outdated
Comment on lines 123 to 125
### 4. Handling `anyOf` with Clarity

The `anyOf` keyword is a powerful but complex JSON Schema feature. **Better-JSON-Schema-Errors** intelligently simplifies its output by providing clear, consolidated error messages that are easier to debug. For detailed examples, see the dedicated [**anyOf** documentation](./docs/anyOf.md).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have several keywords with their own documentation file and I don't want to list each one of them individually. We should be able to describe some of the general strategies we use in the README and then link to the documentation directory as a whole for people to look through the individual documentation files.

I think here in the README we should talk about our general strategy of trying to determine which alternative the user intended and only showing those messages. Then the individual documentation can describe how we determine which alternative to choose.

@arpitkuriyal arpitkuriyal merged commit 947cd5d into hyperjump-io:main Aug 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants