main
1# frozen_string_literal: true
2
3json.key_format! camelize: :lower
4if mode?(:server)
5 json.meta do
6 render meta, json: json
7 end
8end
9json.schemas schemas.map(&:id)
10json.id id if mode?(:server)
11json.external_id external_id if mode?(:client) && external_id
12schemas.each do |schema|
13 if schema.core?
14 schema.attributes.each do |type|
15 attribute = dynamic_attributes[type.name]
16 render attribute, json: json
17 end
18 else
19 json.set! schema.id do
20 schema.attributes.each do |type|
21 attribute = dynamic_attributes[type.fully_qualified_name] ||
22 dynamic_attributes[type.name]
23 render attribute, json: json
24 end
25 end
26 end
27end