2 个仓库
Adapters used to adjust the output structure of a JSON response to meet specific standards or custom root requirements.
Distinct from JSON Structure Management: Candidates focus on JSON repair or C-struct conversion; this is about high-level API response structure.
Explore 2 awesome GitHub repositories matching web development · JSON Structure Adapters. Refine with filters or upvote what's useful.
Active Model Serializers 是一个 Ruby on Rails JSON 序列化器,用于将模型对象和关联转换为用于 API 的结构化 JSON 响应。它作为一个模型到 JSON 的映射器和响应格式化程序,将内部数据库模式与外部 API 契约解耦。 该项目利用可插拔适配器模式根据特定标准(如 JSON API 规范)组织序列化数据。它提供了一种将内部属性映射到自定义 JSON 键的机制,并实现了一个序列化作用域,允许根据授权上下文和用户权限进行属性和关联过滤。 该工具集通过使用虚拟属性以及通过侧加载(sideloading)或 ID 嵌入管理关联数据来涵盖数据转换。它包括用于响应元数据注入、基于片段的结果缓存以及用于跟踪序列化指标的性能检测的功能。
Adjusts the output structure using adapters to satisfy specific API standards or root key requirements.
Jbuilder 是一个用于 Ruby 的 JSON 模板引擎和构建器,提供了一种用于生成结构化 JSON 对象的领域特定语言(DSL)。它作为视图助手,使用逻辑、条件和循环将数据转换为 JSON 格式。 该项目通过使用局部模板(partials)和嵌套对象来构建复杂的数据结构,以保持模块化。它包括运行时键转换功能,允许在不同的命名约定(如蛇形命名法和驼峰命名法)之间转换属性键。 该系统支持动态 JSON 结构化,能够定义运行时键并管理 null 值的输出。它还提供了一种缓存渲染后的 JSON 片段的机制,以减少重复处理。
Adapts the output structure of JSON responses to meet specific external API standards and requirements.