Skip to content

Update attributes-and-content-types-names-reserved.md #2215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

innerdvations
Copy link
Collaborator

@innerdvations innerdvations commented Sep 16, 2024

What does it do?

fixes list of reserved names

note: I'm not sure what was allowed in v4, but these are the current lists of restricted attributes and models directly from the code in v5

export const reservedAttributes = [
  // ID fields
  'id',
  'document_id',

  // Creator fields
  'created_at',
  'updated_at',
  'published_at',
  'created_by_id',
  'updated_by_id',
  // does not actually conflict because the fields are called *_by_id but we'll leave it to avoid confusion
  'created_by',
  'updated_by',

  // Used for Strapi functionality
  'entry_id',
  'status',
  'localizations',
  'meta',
  'locale',
  '__component',
  '__contentType',

  'strapi*',
  '_strapi*',
  '__strapi*',
];

export const reservedModels = [
  'boolean',
  'date',
  'date_time',
  'time',
  'upload',
  'document',
  'then', // no longer an issue but still restricting for being a javascript keyword

  'strapi*',
  '_strapi*',
  '__strapi*',
];

Why is it needed?

Describe the issue you are solving.

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

Copy link

vercel bot commented Sep 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 1:12pm

@pwizla pwizla self-assigned this Sep 16, 2024
@pwizla pwizla added source: Dev Docs PRs/issues targeting the Developer Docs v5 Documentation PR that targets Strapi v5 temp: add to release notes labels Sep 16, 2024
@pwizla pwizla added this to the 5.0.0 (stable) milestone Sep 16, 2024
@pwizla pwizla added the pr: updated content PRs updating existing documentation content label Sep 16, 2024
@pwizla pwizla merged commit 8e88e16 into next Sep 16, 2024
3 checks passed
@pwizla pwizla deleted the innerdvations-patch-2 branch September 16, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: updated content PRs updating existing documentation content source: Dev Docs PRs/issues targeting the Developer Docs v5 Documentation PR that targets Strapi v5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants