blst-security/cherrybomb

Prevent fields being listed in `required` that are not in properties

Closed this issue · 2 comments

jayvdb commented

Is your feature request related to a problem? Please describe.
The required list of fields in a schema can get out of sync with the fields actually present in the schema's properties list.

This is less likely to occur when the schemas are generated from the application, but more likely in an API-first approach when there app is built from the spec.

Describe the solution you'd like
Passive check that detect a name in required that isnt in properties.

Describe alternatives you've considered
While this is less about "is the API working correctly", but is the API consistent with itself.

Additional context
Provided this feature is desirable in cherrybomb, I could take this one on as it is a simple check.

GuyL99 commented

This is an interesting suggestion, we'll review and and create one if we decide it aligns with cherrybomb's current goals.
BTW, do you want to maybe build this check? you can fork the repo and one of us can hop into a call with you to help you get started.

jayvdb commented

ya I wrote above

I could take this one on as it is a simple check.

I feel like I could get this done on my own - small and simple