skydread1/flybot.sg

Validation of pattern `:with` params are not being done if the params are maps

skydread1 opened this issue · 0 comments

Problem

In theory the, params of :with should be validated by the pattern and we should not need any further validation in the operation functions.

The reason, these validations are not happening is because of the all-keys-optional wrapper in api-schema.

So we should make sure that the keys of the schemas in the :with params are not being set optional.

This error only concern params with map inside :with option such as:

[:new-post [:=> [:cat post-schema-create] post-schema]] ;;  post-schema-create gets all his keys set to optional which is not expected behaviour

Suggestion

  • modify all-keys-optional to not affect the params inside :=>