Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Derive access level of generate CodingKeys from @Codable model

Open
#49 5 comments 2 reactions 0 assignees View on GitHub

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

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

enhancement good first issue

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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SwiftyLab/MetaCodable

All issues in SwiftyLab/MetaCodable

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.