Class: Granola::SchemaSerializer

Inherits:
Serializer show all
Defined in:
lib/granola/schema.rb

Overview

Public: Schema serializer to render your JSON schemas.

Example:

serializer = SchemaSerializer.new(PersonSerializer.schema)
serializer.to_json

Instance Method Summary collapse

Methods included from Granola::Serializer::Schema

included, #valid?, #validation_errors

Instance Method Details

#dataObject



58
59
60
61
62
63
# File 'lib/granola/schema.rb', line 58

def data
  {
    "$schema".freeze => "http://json-schema.org/schema#".freeze,
    "type".freeze => "object".freeze
  }.merge(object)
end