1 个仓库
Manages the high-level organization of the JSON document, such as creating flat lists or nested structures via adapters.
Distinct from Structured Document Serialization: Candidates focus on documentation generators or DB exports; this is about the structural shape of an API response.
Explore 1 awesome GitHub repository matching web development · Document Structure Control. Refine with filters or upvote what's useful.
Active Model Serializers 是一个 Ruby on Rails JSON 序列化器,用于将模型对象和关联转换为用于 API 的结构化 JSON 响应。它作为一个模型到 JSON 的映射器和响应格式化程序,将内部数据库模式与外部 API 契约解耦。 该项目利用可插拔适配器模式根据特定标准(如 JSON API 规范)组织序列化数据。它提供了一种将内部属性映射到自定义 JSON 键的机制,并实现了一个序列化作用域,允许根据授权上下文和用户权限进行属性和关联过滤。 该工具集通过使用虚拟属性以及通过侧加载(sideloading)或 ID 嵌入管理关联数据来涵盖数据转换。它包括用于响应元数据注入、基于片段的结果缓存以及用于跟踪序列化指标的性能检测的功能。
Controls the final structure of the JSON response, allowing for flat lists or specific specification layouts.