Protocol extending Encodable (or Codable) does not conform to it
I have 2 protocols, Filters and Parameters , both of which extend Encodable protocol Filters: Encodable { var page: Int { get } } protocol Parameters: Encodable { var type: String { get } var filters: Filters { get } } I create structs conforming to these protocols, thusly… struct BankAccountFilters: Filters { var page: Int var isWithdrawal: Bool } struct BankAccountParamters: Parameters { let type: String = "Bank" var filters: Filters } let baf = BankAccountFilters(page: 1, isWithdrawal: true) let bap = BankAccountParamters(filters: baf) Which fails because… error: type 'BankAccountParamters'