jmcarp / flask-apispec

MIT License
655 stars 156 forks source link

Fix `default_in` error when location is not provided #166

Closed zzz4zzz closed 4 years ago

zzz4zzz commented 5 years ago

This should resolve issue #165

AbdealiLoKo commented 4 years ago

The commit where this was changed in apispec: https://github.com/marshmallow-code/apispec/commit/fbddd8b1c41db31e10f83c91436feff3ba21f6aa This commit has been available in 3.0.0+

I'm only unsure whether the value should be set to "body" or None. Setting to "body" => we retain previous behavior. Setting to None => we use the default the apispec will use (which I guess is currently "body" ... but may channge later?).

As of now it shouldnt impact as both will use "body", so I think "body" is fine.

@sloria can this be merged ? Looks like atleast 5 users have found this useful

nicobytes commented 4 years ago

@sloria any update for this MR?

sloria commented 4 years ago

Sorry for the delay. Will give this a look after work today.

AbdealiLoKo commented 4 years ago

Seems like I was mistaken here. When I am using it in one of my applications, I see that even GET params are being set to "body" and not correctly to the query params.

sloria commented 4 years ago

I won't have time to dig into this in the near future. @AbdealiJK Would you like to send a PR?

AbdealiLoKo commented 4 years ago

Yep, I know the fix. I'm just trying to create some test cases to ensure my understanding is right and a regression doesn't occur