mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
parent
7bc561127d
commit
006b62fd12
2 changed files with 9 additions and 0 deletions
|
@ -37,6 +37,11 @@ switched to a new configuration mechanism, however it was not officially removed
|
||||||
- Add documented-but-missing chat pagination.
|
- Add documented-but-missing chat pagination.
|
||||||
- Allow sending out emails again.
|
- Allow sending out emails again.
|
||||||
|
|
||||||
|
## Unreleased (Patch)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- API: Empty parameter values for integer parameters are now ignored in non-strict validaton mode.
|
||||||
|
|
||||||
## [2.1.2] - 2020-09-17
|
## [2.1.2] - 2020-09-17
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
@ -115,6 +115,10 @@ defmodule Pleroma.Web.ApiSpec.CastAndValidate do
|
||||||
%{reason: :unexpected_field, name: name, path: [name]}, params ->
|
%{reason: :unexpected_field, name: name, path: [name]}, params ->
|
||||||
Map.delete(params, name)
|
Map.delete(params, name)
|
||||||
|
|
||||||
|
# Filter out empty params
|
||||||
|
%{reason: :invalid_type, path: [name_atom], value: ""}, params ->
|
||||||
|
Map.delete(params, to_string(name_atom))
|
||||||
|
|
||||||
%{reason: :invalid_enum, name: nil, path: path, value: value}, params ->
|
%{reason: :invalid_enum, name: nil, path: path, value: value}, params ->
|
||||||
path = path |> Enum.reverse() |> tl() |> Enum.reverse() |> list_items_to_string()
|
path = path |> Enum.reverse() |> tl() |> Enum.reverse() |> list_items_to_string()
|
||||||
update_in(params, path, &List.delete(&1, value))
|
update_in(params, path, &List.delete(&1, value))
|
||||||
|
|
Loading…
Reference in a new issue