Skip to content

Commit

Permalink
#36: Fixes bug when referencing root schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonwasrobot committed Jun 19, 2017
1 parent 853aee8 commit f238a54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/printer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,12 @@ defmodule JS2E.Printer do
schema_id = determine_schema_id(identifier)
schema = schema_dict[to_string(schema_id)]
schema_type_dict = schema.types
schema_type_dict[to_string(identifier)]

if to_string(identifier) == schema_id do
schema_type_dict["#"]
else
schema_type_dict[to_string(identifier)]
end

true ->
Logger.error("Could not resolve '#{identifier}'")
Expand Down

0 comments on commit f238a54

Please sign in to comment.