Skip to content
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

Additional Properties not identified #81

Open
aakhan1 opened this issue Sep 12, 2020 · 1 comment
Open

Additional Properties not identified #81

aakhan1 opened this issue Sep 12, 2020 · 1 comment
Assignees

Comments

@aakhan1
Copy link
Contributor

aakhan1 commented Sep 12, 2020

In a prior version (v0.1.1), the specific additional properties were identified in the error message when additionalProperties keyword was set to false in the schema.

This no longer appears to be the case in v2. Was this feature removed? Is there way to retrieve the name of the additional property that is the source of the exception?

@Arqu Arqu self-assigned this Sep 13, 2020
@aakhan1
Copy link
Contributor Author

aakhan1 commented Oct 29, 2020

Hi @Arqu. I was investigating this issue to see if this something I can address (I am a bit of a noob here).

There are two places where I believe the feature needs enhancement. I had a couple ideas on how to address this, but would like your thoughts. One easy way would be to pass key instead of data to AddError(), the second would be add in the property name to the error message. This would be similar to the error message in regular fields. The field name is included in the message in double quotes.

Both of these could end up being breaking changes as it changes the behavior. So wondering if you had more insight on how to approach this.

if ap.schemaType == schemaTypeFalse {
currentState.AddError(data, "additional properties are not allowed")
return
}

if up.schemaType == schemaTypeFalse {
currentState.AddError(data, "unevaluated properties are not allowed")
return
}

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

No branches or pull requests

2 participants