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

Property is_array NOT applied on array of custom_classes #10

Open
jan-benda-hci opened this issue Jul 23, 2020 · 0 comments
Open

Property is_array NOT applied on array of custom_classes #10

jan-benda-hci opened this issue Jul 23, 2020 · 0 comments

Comments

@jan-benda-hci
Copy link

Hi,
first of all - great plugin, thank you!

I've ran into an issue checking the items of an array of custom classes.

My plugin configuration looks like this:
{ "name": "request-firewall", "config": { "debug": true, "err_code": 422, "exact_match": { "/pcidss/InitiateAction": { "POST": { "content_type": "application/json", "body": { "ProcessorId": { "type": "string","max": "24","required": true,"match": "^[%w%s%.%-%:%(%);,=/]*$" }, "Credentials": { "type": "CredentialsObject","min": "1","required": true,"is_array": "1" } }, "custom_classes": { "CredentialsObject": { "Id": { "type": "string","min": "36","max": "36","required": true,"match": "^[%w%s%.%-%:%(%);,=/]*$" }, "Text": { "type": "string","max": "254","match": "^[%w%s%.%-%:%(%);,=/]*$" } } } } } } } }

When I validate the following object
{ "ProcessorId": "567", "Credentials": [ { "Id": "29c76e0b-8ede-4b60-8f30-56a18dcf6967", "Text": "0492192277" } ] }

The response is:
Unexpected parameter in body.Credentials.1

When I try to validate the same as object (not an array), it works.
{ "ProcessorId": "567", "Credentials": { "Id": "29c76e0b-8ede-4b60-8f30-56a18dcf6967", "Text": "0492192277" } }

Is the is_array property ignored for custom_classes?

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

1 participant