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

[Bug - Swift] segment file does not observe access-level: public specified in typewriter.yml #316

Open
daveneff opened this issue Mar 6, 2024 · 0 comments

Comments

@daveneff
Copy link

daveneff commented Mar 6, 2024

Bug report 🐞

Issue and steps to reproduce.

typewriter.yml file contains a parameter access-level, which allows users to specify which access level generated code should have. However, the generated file segment does not observe the provided access level - it always applies the internal access level.

This is problematic in cases where generated code is contained in a separate Package, as consumers are unable to access any of the generated functions on the extension of Analytics, since the access control cannot be made public.

Repro steps

  1. Set the access-level: public in typewriter.yml:
    client:
      language: swift
      sdk: swift
      languageOptions:
        access-level: public
    
  2. Run the codegen using npx typewriter
  3. Observe that the file segment does not observe the specified public access level

Expected

In the generated file segment, extension Analytics should have the access level specified in typewriter.yml (in this case, public):

public extension Analytics {  
    // generated event functions
}

Actual

In the generated file segment, extension Analytics has an internal access level:

extension Analytics {
    // generated event functions
 }

Versions. (Typewriter, OS, language, etc.)

  • Typewriter version: typewriter/9.1.0 darwin-arm64 node-v19.5.0
  • Language: Swift
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

No branches or pull requests

1 participant