luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.59k stars 156 forks source link

MissingNestedParamError with only form data #1782

Closed watzon closed 1 year ago

watzon commented 1 year ago

Describe the bug I'm trying to save a file using a SaveOperation. The operation itself has no permitted params, just a file_attribute named file. When the params get passed to the save operation's create method, I get an error coming from here which I assume is because the params are technically empty.

To Reproduce Steps to reproduce the behavior:

Example:

  1. Generate a Lucky project '...'
  2. Create a save operation for a model
  3. Add file_attribute :file to the top of the save operation. No permitted_params.
  4. Create an action which calls the save operation's create method, passing in params.
  5. Attempt to call the route, passing in a file.

Expected behavior I'd expect the file to get passed in just fine. But instead I get a MissingNestedParamError.

Screenshots/code

image

shard. Lock (please complete the following information):**

jwoertink commented 1 year ago

Turns out, this should be fixed in 1.0.0 by https://github.com/luckyframework/avram/pull/894 If you get a chance, can you give that a try and if so, we can close this.

jwoertink commented 1 year ago

I'm gonna go ahead and close this. I'm pretty sure it's fixed. If anyone else runs in to it again, we can always reopen