[Feature Request]: Provide public default initializers for public structs

Open
#216 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
swift
Domain
api

Research direction

Start by locating the generated model for ComAtprotoLexicon.Server.CreateSessionRequestBody and checking how its initializer access level is defined. Look for other public structs with public initializers to understand the project’s pattern. Done means callers can construct the requested public model with the fields shown in the example; the issue does not identify a test or broader model generation entry point.

Written by the indexing model from the issue text.

Description

new feature
Summary

Public structs do not have public initializers

Pain points

I wanted to use the struct ComAtprotoLexicon.Server.CreateSessionRequestBody but I am unable to instantiate it.

'ComAtprotoLexicon.Server.CreateSessionRequestBody' initializer is inaccessible due to 'internal' protection level

would it be possible to update the models to have public initializers?

Considered Alternatives

None!

Is this a breaking change?

Yes

Library Examples

self.payload = .init(identifier: username, password: password, authFactorToken: authFactorToken)

Additional Context

No response

Dominant language
Swift
Stars
226
Forks
40
Avg merge
2h 56m
Merged PRs (30d)
3

Getting set up

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 MasterJ93/ATProtoKit

All issues in MasterJ93/ATProtoKit

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.