You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently some values have defaults (product SKU, priceValidUntil…). This is handled through setIfEmpty function.
We should allow to opt out from default values if for whatever reason we want to discard a property. So instead of just checking for falseness, we might check for undefined and let users override this.
In that case, remove the property from the output if set to null.
{
...
sku: null,// explicitly left out}
Additional information
Would you be willing to help implement this feature?
I support this feature. I am trying to get rid of the url property for an organization in a job posting and there's no way. The url property has a fallback to the default url (I assume the one configured with NuxtSeo in my case) whenever the value is empty. I like being able to discard the property if null but also not sure if that could impact other properties.
I suspect is due to this but still unsure how the package works:
Activity
IsraelOrtuno commentedon Jul 11, 2025
I support this feature. I am trying to get rid of the
urlproperty for an organization in a job posting and there's no way. Theurlproperty has a fallback to the default url (I assume the one configured with NuxtSeo in my case) whenever the value is empty. I like being able to discard the property ifnullbut also not sure if that could impact other properties.I suspect is due to this but still unsure how the package works:
https://github.com/unjs/unhead/blob/main/packages/schema-org/src/nodes/Organization/index.ts#L102
fix(schema-org): allow null to opt out of default values
fix(schema-org): allow null to opt out of default values (#680)