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

Mapping an optional field #162

Open
neetso opened this issue Nov 18, 2020 · 1 comment
Open

Mapping an optional field #162

neetso opened this issue Nov 18, 2020 · 1 comment

Comments

@neetso
Copy link

neetso commented Nov 18, 2020

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?

@rubydog
Copy link
Collaborator

rubydog commented Nov 19, 2020

Hey @neetso,

I am looking into it. I will get back to you if I need more details.

Cheers

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

No branches or pull requests

2 participants