Skip to content

Commit f238a54

Browse files
#36: Fixes bug when referencing root schema
1 parent 853aee8 commit f238a54

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/printer.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,12 @@ defmodule JS2E.Printer do
191191
schema_id = determine_schema_id(identifier)
192192
schema = schema_dict[to_string(schema_id)]
193193
schema_type_dict = schema.types
194-
schema_type_dict[to_string(identifier)]
194+
195+
if to_string(identifier) == schema_id do
196+
schema_type_dict["#"]
197+
else
198+
schema_type_dict[to_string(identifier)]
199+
end
195200

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

0 commit comments

Comments
 (0)