# \[dry-struct\] How to reuse dry-struct?

**URL:** <https://discourse.dry-rb.org/t/dry-struct-how-to-reuse-dry-struct/886>\
**Category:** dry-types\
**Created:** [August 15, 2019, 6:36am UTC](https://discourse.dry-rb.org/t/dry-struct-how-to-reuse-dry-struct/886 "2019-08-15T06:36:33Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![radf0x](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/radf0x/32/428_2.png) [@radf0x](https://discourse.dry-rb.org/u/radf0x)\
**Post date:** [August 15, 2019, 6:36am UTC](https://discourse.dry-rb.org/t/dry-struct-how-to-reuse-dry-struct/886/1 "2019-08-15T06:36:33Z")

</div>

Hi there,  
I am trying make structs reusable, consider the following structs:  
structs/pet\_store.rb

```auto
class PetStore < Dry::Struct
  attribute :address, Types::String
  attribute :cat, Pet
  attribute :dog, Pet
end

```

structs/pet.rb

```auto
class Pet < Dry::Struct
  attribute :name, Types::String
  attribute :gender, Types::String

```

However im getting `Attribute :name has already been defined (Dry::Struct::RepeatedAttributeError)` when starting my rails server  
Any help would be appreciated, thanks!

---

_[View the full topic](https://discourse.dry-rb.org/t/dry-struct-how-to-reuse-dry-struct/886)._
