Clever / wag

sWAGger - Web API Generator
Apache License 2.0
77 stars 6 forks source link

Fix edge case where composite attribute is used multiple times as a key for an index #318

Closed dengjulie closed 3 years ago

dengjulie commented 3 years ago

There are duplicate type definitions when a composite attribute is used multiple times as the range key for an index. This PR moves the logic for these struct definitions to be calculated per composite attribute rather than per index. I also ended up finding a bug with the tests - not all of an object's required fields are specified for saving to the db, which causes null pointer dereferences. This specifically happens for a the required fields for composite attribute since we have to access the fields when creating the attribute.