Skip to content
This repository has been archived by the owner on Feb 8, 2021. It is now read-only.

Allow non-Optional properties #25

Closed
hkellaway opened this issue Aug 17, 2015 · 3 comments
Closed

Allow non-Optional properties #25

hkellaway opened this issue Aug 17, 2015 · 3 comments
Assignees
Milestone

Comments

@hkellaway
Copy link
Owner

Suggested by @Haud

@hkellaway hkellaway self-assigned this Aug 17, 2015
@hkellaway hkellaway added this to the 0.4.0 milestone Aug 17, 2015
@Haud
Copy link

Haud commented Aug 18, 2015

Yes!

I've had time to take a deeper look into the code base. My thoughts are maybe there can be two operators: <~? for optional and <~! for non-optional. I think it's more immediately clear that way which operator does what, though I'm ok with <~~ and a non-optional type: <~~! or something.

I would also be more in favor of a init( json: JSON) as the protocol method than fromJSON, though I do understand its semantic equivalent in Encoder's toJSON

@hkellaway
Copy link
Owner Author

good suggestions! i'll keep you posted

@hkellaway
Copy link
Owner Author

the referenced PRs take your suggestions into account. non-optional properties are now allowed by using forceDecode_ functions or by using the <~~! operator. Additionally, I did like the idea of having to initialize with JSON, so the Decodable protocol was updated to reflect that.

you'll see these updates in 0.4.0 💥

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants