Question: Is there anyway to override spring boot property of parent context in child context?

I had tried various options: 

1) Both parent & child in respective XML: property-placeholder ordering similar to non boot project (child order > parent order) : **Not working**

```
<context:property-placeholder location="classpath:parent-config.properties" order="-10"
        ignore-unresolvable="true" ignore-resource-not-found="true" />
<context:property-placeholder location="classpath:child-config.properties" order="-5"
        ignore-unresolvable="true" ignore-resource-not-found="true" />

```

2) Both parent & child in respective Java @Configuration : **Not working**

```
@PropertySource(value={"classpath:parent-config.properties"}, ignoreResourceNotFound=true)
@PropertySource(value={"classpath:child-config.properties"})

```

3) Parent in XML property-placeholder & child in Java `@Configuration` : **Works some times, not Always**

```
<context:property-placeholder location="classpath:parent-config.properties" order="-10"
            ignore-unresolvable="true" ignore-resource-not-found="true" />
 @PropertySource(value={"classpath:child-config.properties"})

```

4) Both parent & child in `@PropertySource` of `@Configuration` in order: **Working**

```
@PropertySource(value={"classpath:parent-config.properties", "classpath:child-config.properties"})

```

As I am importing/extending parent context which already have "classpath:parent-config.properties", I should not be mentioning the parent config again in child.
Is there any proper solution for the same??

Answer: 
`NSJSONSerialize` and friends can only deal with small subset of NSObject children (NSNumber, NSString, NSArray, NSDictionary, and NSNull) that correspond to the JSON native data types. In addition, a Dictionary can only be converted to an NSDictionary if both the key and value are NSObject or inherently convertible to NSObject (String and numeric types).

In order to serialize your Dictionary you'll need to convert the Enum to one of those NSJSONSerialize data-types, similar to your example:

```
enum MyEnum : String {
    case one = "one"
    case two = "two"
}

let dict = ["one":MyEnum.one, "two":MyEnum.two]

var newDict = Dictionary<String, String>()
for (key, val) in dict {
    newDict[key] = val.rawValue
}

let data = NSJSONSerialization.dataWithJSONObject(newDict, options: .allZeros, error: nil)

```

As an alternative, since this kind of manipulation is fairly common, you might want to consider adding this category to Dictionary, which gives it a convenient `map` function:

```
extension Dictionary {
    init(_ pairs: [Element]) {
        self.init()
        for (k, v) in pairs {
            self[k] = v
        }
    }

    func map<K: Hashable, V>(transform: Element -> (K, V)) -> [K: V] {
        return Dictionary<K, V>(Swift.map(self, transform))
    }
}

```

Once that's done, the conversion is simply:

```
let mapped = dict.map { (key, value) in (key, value.rawValue) }

```
```
public protocol EnumCollection: Hashable {
    static func cases() -> AnySequence<Self>
    static var allValues: [Self] { get }
}

public extension EnumCollection {

    public static func cases() -> AnySequence<Self> {
        return AnySequence { () -> AnyIterator<Self> in
            var raw = 0
            return AnyIterator {
                let current: Self = withUnsafePointer(to: &raw) { $0.withMemoryRebound(to: self, capacity: 1) { $0.pointee } }
                guard current.hashValue == raw else {
                    return nil
                }
                raw += 1
                return current
            }
        }
    }

    public static var allValues: [Self] {
        return Array(self.cases())
    }
}

public enum ScreenName: String, EnumCollection
{
    case HomeView = "Home View"
    case SignUpViewController = "Domain Validate View"

    var name: String {
        get { return String(describing: self) }
    }
    var description: String {
        get { return String (self.rawValue) }
    }

    // a dictionary mapping the raw values to the values
    static var allValuesDictionary: [String : String]{
        var values = [String : String]()

        let mirror = Mirror(reflecting: ScreenName.allValues)
        for (_, v) in mirror.children{
            guard let screenName = v as? ScreenName else{continue}
            values[screenName.name] = screenName.description
        }
        return values
    }
}

```

Now you can call the method `allValuesDictionary` will return the dictionary with `<key, value> = <case, rawValue>`

```
<HomeView, "Home View">, <SignUpViewController, "Domain Validate View">

```