title: Is this Int64 Swift Decoding superfluous?
body: <p>I have seen a piece of code online which uses Swift Codable do decode a JSON into a struct.</p>
  <pre><code>init(from decoder: Decoder) throws {
      let container = try decoder.container(keyedBy: CodingKeys.self)
      if let stringValue = try? container.decode(String.self, forKey: .someId), let value = Int64(stringValue) {
          someId = value
      } else {
          someId = try container.decode(Int64.self, forKey: .someId)
      }
  }
  </code></pre>
  <p>This code:</p>
  <ul>
  <li>decodes a string</li>
  <li>tries to parse it into <code>Int64</code></li>
  <li>if it fails - it directly attempts to decode an <code>Int64</code></li>
  </ul>
  <p>My question is - is this code superfluous?</p>
  <p>Is there any scenario where <code>Int64.init(_:)</code> from <code>String</code> would be able to decode something that <code>JSONDecoder.decode</code> wouldn't?</p>
  <p>And actually, isn't this &quot;decode String - init Int64&quot; the exact same thing that <code>JSONDecoder</code> does under the hood?</p>