Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Allow nested structured in payload to be considered by "require_params" #23

Open
@sukria

Description

@sukria

Currently, SPORE only checks for keys in the params structure that it's passed. This is fine with GET request, or QUERY_STRING args but not when it comes to provide a value in the structure given in payload.

For instance, let's say I have

required_params: 
  - "foo"
  - "bar"

If I do the following:

$spore->some_action( payload => { 
  foo => 42,
  bar => 43,
});

This will fail, triggering a "required param is missing" error, which is wrong, as the user submitted the expected parameter, in the body.

Probably, we should also allow nested checks like :

required_params:
  - "object"
  - "object.key1"

$spore->some_action( payload => { 
  object => {
     key1 => ... 
   }
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions