Derive access level of generate CodingKeys from @Codable model
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- swift
- Domain
- developer-experience
Research direction
The issue gives a public @Codable model and shows the generated CodingKeys declaration as internal; it does not name implementation files or tests. Start by reading the macro implementation and its tests for generated CodingKeys access levels. Done means generated keys use the model’s access level and are accessible from another package; the issue has had no comment for 1,031 days.
Written by the indexing model from the issue text.
Description
Right now @Codable macro will generate CodingKeys with internal access level.
@Codable
@CodingKeys(.PascalCase)
public struct MessageReceiver {
public let userId: UUID
public let status: OData.Enum<Int>
}
extension MessageThread.Response.MessageReceiver {
enum CodingKeys: String, CodingKey {
case userId = "UserId"
case status = "Status"
}
}
It would great to generate CodingKeys with the same access level (public) as MessageReceiver. This would allow access to CodingKeys in multi package application. As of my particular use case I would like to build OData requests using CodingKeys instead of String from the domain layer of application.
Really appreciate effort in open sourcing the project, unfortunately internal macros plugin implementation is quite complicated to be able to make a quick PR with solution.
- Dominant language
- Swift
- Stars
- 779
- Forks
- 46
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SwiftyLab/MetaCodable
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SwiftyLab/MetaCodable#169 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
SwiftyLab/MetaCodable#82 · 6 comments ·
All issues in SwiftyLab/MetaCodable
Similar issues
-
simulator-session.yml の simtunnel の固定先が古く、agentd が無いため simtunnel up --wait / status が準備完了を検知できないOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
apache/arrow-swift#203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
RealtimeV2 fails to compile on Xcode 27.1 / Swift 6.4: ambiguous implicit access level for import of 'HTTPTypes'Possibly taken A pull request linked to this issue is open or already merged. OpenRealtime swift
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supabase/supabase-swift#1647 ·
Maintainers usually reply within 1 day
-
[Pri] Low [Status] Ready for Dev [Type] Bug /Me
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
wordpress-mobile/WordPress-iOS#26279 · 1 comment ·
Maintainers usually reply within 1 day