# \[dry-struct\] attributes ending with a question mark

**URL:** <https://discourse.dry-rb.org/t/dry-struct-attributes-ending-with-a-question-mark/866>\
**Category:** Support\
**Created:** [August 1, 2019, 7:40am UTC](https://discourse.dry-rb.org/t/dry-struct-attributes-ending-with-a-question-mark/866 "2019-08-01T07:40:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DawidJanczak](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/dawidjanczak/32/261_2.png) [@DawidJanczak](https://discourse.dry-rb.org/u/DawidJanczak)\
**Post date:** [August 1, 2019, 7:40am UTC](https://discourse.dry-rb.org/t/dry-struct-attributes-ending-with-a-question-mark/866/1 "2019-08-01T07:40:43Z")

</div>

Hello!

We have a legacy JSON that gets wrapped with `dry-struct` instances. Some of the keys of said JSON end with a question mark, e.g. `last_minute?` This was all working fine before, but I just bumped `dry-struct` from 0.6 to 1.0 and noticed it now crashes with `NoMethodError: undefined method`last\_minute?’` I didn’t find anything in Changelog so I figured I’d ask here if that’s a regression or if that was never supposed to be supported.

---

<div class="post-metadata">

**Author:** ![flash-gordon](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/flash-gordon/32/494_2.png) [@flash-gordon](https://discourse.dry-rb.org/u/flash-gordon)\
**Post date:** [August 1, 2019, 8:12am UTC](https://discourse.dry-rb.org/t/dry-struct-attributes-ending-with-a-question-mark/866/2 "2019-08-01T08:12:49Z")

</div>

Actually, it was done on purpose. dry-types now has syntax for defining omittable keys by appending `?`. dry-struct works the same way for consistency. I didn’t implement a workaround for keys ending with `?` because it wasn’t clear this use case even exists in real life. Now few months later, it seems it does exist so feel free to submit a feature request to dry-struct, I’ll try to find a reasonable method.

---

<div class="post-metadata">

**Author:** ![DawidJanczak](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/dawidjanczak/32/261_2.png) [@DawidJanczak](https://discourse.dry-rb.org/u/DawidJanczak)\
**Post date:** [August 1, 2019, 9:51am UTC](https://discourse.dry-rb.org/t/dry-struct-attributes-ending-with-a-question-mark/866/3 "2019-08-01T09:51:53Z")

</div>

Thank you @flash-gordon, but given what you said it might become confusing if we add this feature so let’s leave it as is. We can always use `transform_keys` to remove the `?` 🙂
