Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a data transfer object instead of direct model encoding/decoding #128

Merged
merged 7 commits into from
May 6, 2024

Conversation

gwynne
Copy link
Member

@gwynne gwynne commented Apr 2, 2024

The current recommendation when working with Fluent models is to use DTOs (data transfer objects) when decoding requests and encoding responses, rather than conforming the models themselves to Content as has been done historically. Our template project should reflect that recommendation.

Also includes tests for the TodoController routes when Fluent is selected.

@gwynne gwynne requested review from 0xTim, MahdiBM and ptoffy April 2, 2024 09:34
Tests/AppTests/AppTests.swift Show resolved Hide resolved
Sources/App/DTOs/TodoDTO.swift Outdated Show resolved Hide resolved
Tests/AppTests/AppTests.swift Show resolved Hide resolved
@gwynne gwynne enabled auto-merge (squash) May 6, 2024 16:24
@gwynne gwynne disabled auto-merge May 6, 2024 16:59
@gwynne gwynne force-pushed the dtos branch 7 times, most recently from 8399e4b to a230d9d Compare May 6, 2024 18:25
@gwynne gwynne merged commit 28645e8 into main May 6, 2024
19 checks passed
@gwynne gwynne deleted the dtos branch May 6, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants