Skip to content

Commit

Permalink
Merge pull request #11 from metaplex-foundation/fix/optional-reflection
Browse files Browse the repository at this point in the history
Add support to optional on reflection
  • Loading branch information
ajamaica authored Nov 23, 2022
2 parents 6c19f5c + 94a483c commit 187e8fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/Beet/Beets/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ public func mirrored(value: Any) -> (label: String, params: [String: Any]) {
return ("\(value)", dictionary)
}

if reflection.displayStyle == .enum, let associated = reflection.children.first {
if reflection.displayStyle == .enum || reflection.displayStyle == .optional,
let associated = reflection.children.first {
let values = Mirror(reflecting: associated.value).children
var valuesArray = [String: Any]()
if values.count > 0 {
Expand Down

0 comments on commit 187e8fc

Please sign in to comment.