pyeve / eve

REST API framework designed for human beings
https://python-eve.org
Other
6.69k stars 746 forks source link

[Feature Request] One document Endpoint #1494

Open zaterio opened 1 year ago

zaterio commented 1 year ago

Hi @nicolaiarocci,

Too many times I have needed an endpoint to be used as a configuration point for other applications, for example:

schema_transcoding_config = { 'encoding_enabled': {'type': 'boolean', 'default': True}, 'threads': {'type': 'int', 'default': 1}, }

endpoint only needs one item, and old ones are deleted periodically.

I suggest the following new feature: At the endpoint level, a new setting "one_document_endpoint" (for example): An endpoint configured with "one_document_endpoint", must ensure that only one document is kept, in case of Create/Update Document, old documents must be deleted. DELETE operations on Collection/Document not allowed, Bulk operation not allowed.

Please consider whether this feature is appropriate. I am a volunteer for its implementation.

Thanks!

nicolaiarocci commented 1 year ago

Hi @zaterio. All of this would be attainable, I think, with some 'maintenance activity' on the client side. Like, only send update commands to the single document originally stored at the endpoint. I understand the usefulness though, especially around avoiding unwanted behavior on behalf of rogue (or bugged) clients. Is this the only reason you would want the feature added?