Class: Dry::Doc::Schema::Field

Inherits:
Struct
  • Object
show all
Defined in:
lib/dry/doc/schema.rb

Instance Method Summary collapse

Instance Method Details

#as_jsonObject



10
11
12
13
14
15
# File 'lib/dry/doc/schema.rb', line 10

def as_json
  ast = type.respond_to?(:to_ast) ? type.to_ast : type
  base = walk_ast(ast, {})
  base[:description] = description if description
  base
end