Skip to content

v3: privateAttributes in REST not working (on plugin model?) #12804

@laurenskling

Description

@laurenskling

Bug report

I have a model in a plugin using privateAttributes, but nothing seems to happen.

Describe the bug

in my model (in a plugin) I am using:

options: {
    increments: false,
    timestamps: false,
    privateAttributes: ['__v', '_id', 'source', 'provider_metadata'],
  },

But the output remains the same. Whatever I put in this privateAttributes list.

Steps to reproduce the behavior

Create a model with privateAttributes.
In a plugin.
on MongoDB.

Expected behavior

fields in the privateAttributes should not appear in REST calls

System

  • Node.js version: 14.19.0
  • NPM version: 6.14.15
  • Strapi version: 3.6.0
  • Database: MongoDB <3
  • Operating system: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions