Schema-defined entities
Entities defined with EntitySchema — or MikroORM 7’s defineEntity(), which builds on it — read JSDoc from the exported schema declaration. Descriptions and every JSDoc tag work the same way:
/** * Blog post declared without a decorator class. * @namespace Blog */export const PostSchema = new EntitySchema({ name: 'Post', properties: { id: { primary: true, type: 'integer' }, /** Post title */ title: { type: 'string' }, },});- Name-only schemas (no
class:link, like the example above) also read property JSDoc from inside thepropertiesobject literal — MikroORM 7’sproperties: (p) => ({...})builder callback included. In the column table it beats thecommentproperty option, which stays the fallback. - Class-linked schemas (
class:) read property JSDoc from the class. Entity-level JSDoc merges field by field with the class winning conflicts, and@hiddenapplies when either location has it. - A warning names any schema-defined entity whose declaration could not be read — not found in the scanned sources, ambiguous, or found only in comment-stripped compiled JavaScript — so a
@hiddenwritten there is never dropped silently.