Skip to content

Allow empty schema.org values #548

@Buzut

Description

@Buzut

Describe the feature

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions