Skip to content

Conversation

@mecampbellsoup
Copy link
Contributor

No description provided.

context "when the request body does not adhere to the rules format" do
let(:name) { 1_000 }
context "when a non-specified parameter is included in the request body" do
let(:params) { { name: "M@", email: "[email protected]" } }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kurko do you think 'extra' params should simply be ignored, or should we actually mark the request as being invalid (this is what we're doing now).

Example:

Rules = { data: Hash }

# the `foo` param is not whitelisted
param = { data: {}, foo: "bar" }

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignored, I think. strong parameters does that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two examples below represent (1) ignoring them, not adding an error but filtering out the non-permitted param, or (2) adding an error as we do now in OTX.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Successfully merging this pull request may close these issues.

3 participants