networknt / networknt/json-schema-validator
FeatureRequest: WARN log on additional property
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 352
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 5
Description
Is it possible to add warnings when a property is not included in the schema?
My use case:
Building a data modeling tool built on json-schema, having strict schemas and also using schema composition extensively.
As seen in This issue unevaluatedProperties validates recursively, but additionalProperties does not. When using "allOf" I have to use unevaluatedProperties, but when it is a self-contained schema, we are using additionalProperties=false. This does not apply to any nested object definitions and logging it would help find any instances where a client might use the wrong property name.
Edit: what do you think about a "strict mode" that is configurable so that it fails on addtionalProperties recursively?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no implementation files or tests. Start by reviewing how additionalProperties and unevaluatedProperties are handled, then read issue #826 for the recursive-validation context. Done would require an agreed configurable behavior and corresponding implementation and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100