<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/JSONEncoder/KeyEncodingStrategy-swift.enum/useDefaultKeys",
  "metadataVersion" : "0.1.0",
  "role" : "Case",
  "symbol" : {
    "kind" : "Case",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation11JSONEncoderC19KeyEncodingStrategyO14useDefaultKeysyA2EmF"
  },
  "title" : "JSONEncoder.KeyEncodingStrategy.useDefaultKeys"
}
-->

# JSONEncoder.KeyEncodingStrategy.useDefaultKeys

A key encoding strategy that doesn’t change key names during encoding.

```
case useDefaultKeys
```

## Discussion

The [`JSONEncoder.KeyEncodingStrategy.useDefaultKeys`](/documentation/Foundation/JSONEncoder/KeyEncodingStrategy-swift.enum/useDefaultKeys) strategy is the strategy used if you don’t specify one.

> Note:
> If you use a nested `CodingKeys` enumeration to define custom key names, this strategy continues to use those names rather than reverting back to the original property names. Nested `CodingKeys` enumerations are described in <doc://com.apple.foundation/documentation/Foundation/encoding-and-decoding-custom-types>.

---

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)