Thanks to visit codestin.com
Credit goes to github.com

Skip to content

PUT to create #4266

@temp

Description

@temp

Hi all!

Why is it so hard to implement a PUT endpoint that can create resources? We need this all over the place, for example for transfering things from A to B, without the need of a prior existance check ...

The solution we have found now is to simply disable the serialize listener via an event listener (set api_receive to false) on pre-read, and re-enable it (set api_receive to true) on pre-deserialize.
But, this isn't really rapid application developing, if you need to add these event listeners all the time...

Why not implement a simple api_allow_create_or_update, like with api_allow_update? if this is enabled on the operation, the read listener won't throw an exception. Other solution would be to split api_receive into api_read and api_deserialize, but this has been denied in the past, as far as I can remember.

Or is there another solution which we don't know? We scanned through the listeners, and this seemed like the only option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions