contentful_middleman
contentful_middleman copied to clipboard
Mapping an optional field
Within a mapper, I'm trying to add some additional data derived from my contentful content. However, the field is not required and I get an error: "'empty_field_error': The field 'restrictions' is empty and unavailable in the response'."
In the mapper I tried something like: unless.entry.restrictions.nil? or if.entry.restrictions.present? but I still get the error above.
How can you deal with optional fields in the mapper?
Hey @neetso,
I am looking into it. I will get back to you if I need more details.
Cheers