<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Combine",
  "identifier" : "/documentation/Combine/Publishers/Decode",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Combine"
    ],
    "preciseIdentifier" : "s:7Combine10PublishersO6DecodeV"
  },
  "title" : "Publishers.Decode"
}
-->

# Publishers.Decode

A publisher that decodes elements received from an upstream publisher, using a given decoder.

```
struct Decode<Upstream, Output, Coder> where Upstream : Publisher, Output : Decodable, Coder : TopLevelDecoder, Upstream.Output == Coder.Input
```

## Topics

### Creating a decode publisher

[`init(upstream:decoder:)`](/documentation/Combine/Publishers/Decode/init(upstream:decoder:))

Creates a publisher that decodes elements received from an upstream publisher, using a given decoder.

### Declaring supporting types

[`Publishers.Output`](/documentation/Combine/Publishers/Output)

A publisher that publishes elements specified by a range in the sequence of published elements.

[`Publishers.Decode.Failure`](/documentation/Combine/Publishers/Decode/Failure)

The kind of errors this publisher might publish.

### Inspecting publisher properties

[`upstream`](/documentation/Combine/Publishers/Decode/upstream)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)