Skip to content

Tracking Issue - Some words are not handled well for Model names (Pluralization, ect) and reserved words #1198

@johannpinson

Description

@johannpinson

Edited by @derrickmehaffy on 2021/03/29

This issue has been converted to a global tracking issue regarding certain english or other language words that fail to work when building models. There are various examples, and for the moment the workarounds mean excluding these words from use and doing things like:

news => newsItem ect


Informations

  • Node.js version: 8.9.1
  • npm version: 5.6.0
  • Strapi version: 3.0.0-alpha.12.1.3
  • Database: Mongo v3.4.9
  • Operating system: MacOS 10.13.4

What is the current behavior?
When I create a new content type with a name which have the same plural version, the API generate will loop into a 500

Steps to reproduce the problem

  • Create a new content type named "Fish" (or "News")
  • Use a GraphQL IDE or look the terminal
    capture d ecran 2018-05-15 a 16 56 39

What is the expected behavior?
The problem is that some english words have a specific plural behavior (like child/children) or have the same orthograph
As example : https://github.com/atteo/evo-inflector/blob/master/src/main/java/org/atteo/evo/inflector/English.java#L131

Suggested solutions

Best solution:
Disallow to use "words" which can have an different plural/single mode (ex: fish, news, etc.)

Another solution is to add a flag "all" in front, a.k.a "allFish" (but it add a 2nd behavior so i don't think it's the best solution


  • I'm sure that this feature hasn't already been referenced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: tracking issueSpecial issues used to combine multiple issues into oneissue: bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundsource: core:strapiSource is core/strapi packagestatus: confirmedConfirmed by a Strapi Team member or multiple community members

    Type

    No type

    Projects

    Status

    Closed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions