📙 For any Help, Contact me on Discord (@raideno).
Extend Validators

Extend Entity Validators

Built-In entities are updated through default medusa endpoints. This is why we need to extend those endpoints validators in order to accept new fields and validate them.

1- Extend Validators

IMPORTANT Note: depending on your usecase / fields you added the validators might change, if you need help for creating your validators contact us.

In the same file where you created your entity (previous step):

import { Column, Entity } from "typeorm";
import { Product as MedusaProduct } from "@medusajs/medusa";
import {
} from "medusa-plugin-ultimate/dist/index";
  isBuiltInEntity: true,
  hidden: true,
export class Product extends MedusaProduct {
    type: UltimateEntityFieldTypes.MARKDOWN,
  @Column({ type: "varchar", nullable: true })
  rich_description?: string | null;
import { IsString, IsOptional } from "class-validator";
import { registerOverriddenValidators } from "@medusajs/medusa";
import { AdminPostProductsReq as MedusaAdminPostProductsReq } from "@medusajs/medusa/dist/api/routes/admin/products/create-product";
import { AdminPostProductsProductReq as MedusaAdminPostProductsProductReq } from "@medusajs/medusa/dist/api/routes/admin/products/update-product";
class AdminPostProductsReq extends MedusaAdminPostProductsReq {
  rich_description?: string | null;
class AdminPostProductsProductReq extends MedusaAdminPostProductsProductReq {
  rich_description?: string | null;