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
Type Name Overhaul #9
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ents and EmptyResponse > Empty
…htly more coverage.
zac
force-pushed
the
feature/endpoint-type-renaming
branch
from
December 19, 2022 19:06
628bc0e
to
5810ab3
Compare
weilikuo
approved these changes
Mar 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I'll create a task on Acrylic to migrate to the updated Endpoints
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've gone through the types we use in Endpoints and wanted to unify some naming and clarify some usages.
The biggest change is the renaming of
RequestType
toEndpoint
and theEndpoint
type toDefinition
. So now you create a type conforming toEndpoint
which includes a static propertyDefinition
and the data and components that plugs into the definition. That felt more appropriate given the name of the library, but open to suggestions for other conventions.Other renames include:
Parameters
andHeaderValues
toParameterComponents
andHeaderComponents
respectively. The idea with this change was to name all the data that gets defined in theEndpoint
with the suffix 'components' since they are pieces that plug into theDefinition
EmptyResponse
toEmptyCodable
. This was to resolve some confusion sinceEmptyResponse
is used as theBody
by default... which isn't a response at all.Headers
toHeader
since it represents a single header.Still weighing some alternatives though:
(I went ahead and made this change)Empty
could be better namedEmptyCodable
since that's basically what it isErrorDecoder
could beErrorResponseDecoder
to match other decoder type namesType
suffix from protocols, but not for theEnvironmentType
case. Could shorten that to justEnvironment
, but that might interfere with SwiftUI annoyingly in some projects. Perhaps we should use a completely different name? OrServerEnvironment
?EndpointEnvironment
?I tried to update the documentation to match, but let me know if you see any issues!