Method: Brief::Model::ClassMethods#to_schema

Defined in:
lib/brief/model.rb

#to_schemaObject



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/brief/model.rb', line 127

def to_schema
  {
    schema: {
      content: definition.content_schema,
      metadata: definition.,
    },
    class_name: to_s,
    type_alias: type_alias,
    name: name,
    group: name.to_s.pluralize,
    actions: defined_actions,
    example: definition.example_body.to_s,
    template: definition.template_body.to_s,
    urls: {
      browse_url: "browse/#{ type_alias.to_s.pluralize }",
      schema_url: "schema/#{ type_alias }"
    }
  }
end