Skip to content

Using functions in the fields list #131

@justincy

Description

@justincy

Something like this is possible:

Solicit.Repsponse.ok(conn, struct, [:one, :another, something: Module.function/1])

But it's weird that the full struct is passed in to that function:

solicit/lib/response.ex

Lines 542 to 543 in fdbaeeb

{field, generate} when is_function(generate, 1) ->
{field, generate.(struct)}

Should we instead be passing Map.get(struct, field)? Seems more appropriate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions