urbanairship / ios-library

Urban Airship iOS SDK
http://urbanairship.com
Apache License 2.0
478 stars 265 forks source link

Internal JSON type is declared public #336

Closed mauricecheung closed 2 years ago

mauricecheung commented 2 years ago

Preliminary Info

What Airship dependencies are you using?

AirshipKit 16.9.2 (Core and Animation)

What are the versions of any relevant development tools you are using?

Xcode 13.4.1 Cocoapods 1.11.3

Report

What unexpected behavior are you seeing?

/// - Note: for internal use only.  :nodoc:
public enum JSON: Decodable, Equatable {
    case string(String)
    case number(Double)
    case object([String:JSON])
    case array([JSON])
    case bool(Bool)
    case null

Why is this JSON type declared public? It creates a conflict with the definition of JSON type in our app that did not exist before we updated this library from version 16.9.2. For now, we have to adjust our codebase, which should be unnecessary.

What is the expected behavior?

Your note states that it is for internal use only, so we expect the JSON type to be declared internal. We should not have to update the definition of JSON type in our app for this change.

rlepinski commented 2 years ago

It's public because we have a multi module SDK that one of the modules needs access to the type. We have a lot of fairly generic class names that need to be prefixed to avoid conflicts. We are in the process of converting the rest of the SDK to Swift, once we have done that we will explore a better way of hiding internal classes that need to be used by more than one module.

I'll add this class to the list and try to get a patch out next week with the change.

mauricecheung commented 2 years ago

Thank you @rlepinski

rlepinski commented 2 years ago

Fixed in 16.9.3