vapor / fluent

Vapor ORM (queries, models, and relations) for NoSQL and SQL databases
https://docs.vapor.codes/4.0/fluent/overview/
MIT License
1.32k stars 172 forks source link

Adds EntityTaggableModel for ETag responses #675

Closed grosch closed 4 years ago

grosch commented 4 years ago

Adds a verifyETag(on:) to EventLoopFuture to verify incoming ETag.

Adds a ModelContent protocol which tags Content which includes an init(model:) constructor to generate a DTO based on a model.

Adds withETag and createdWithETag methods to generate a Response that includes the etag and location (on created) headers.

Must be released at the same time as https://github.com/vapor/fluent-kit/pull/243

grosch commented 4 years ago

@tanner0101 @gwynne Thoughts?

grosch commented 4 years ago

It's only here because this is where Model is. If you want to put a protocol into vapor/vapor that knows about Model I'm fine with it moving there.

I opened an issue here: https://github.com/vapor/vapor/issues/2318