Schema $ref (JSON Reference) is a JSON Pointer-based keyword used within JSON Schema and OpenAPI Specification documents to reference another schema definition, either from a different location in the same document or from an external file. This mechanism promotes DRY (Don't Repeat Yourself) principles by allowing common data models, parameter definitions, and response objects to be defined once and referenced multiple times, reducing duplication and maintenance overhead. It is fundamental for creating modular, maintainable API contracts.




