Skip to content

Create a method for converting null strings to empty strings on map. #44

Open
@Benuuu

Description

@Benuuu

Instead of doing something like

extension String {
    static func fromJson(json: Json) -> String {
        return json.stringValue ?? ""
    }
}
func sequence(map: Map) throws {
    try someValue <~ map["someValue"].transformFromJson(String.fromJson)
}

Add a method like: <~ map["someValue"].emptyStringTransform()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions