From ec00acd6ecebf5f4822fc1d925ad845e1d087731 Mon Sep 17 00:00:00 2001 From: Sri Vishnu Totakura Date: Thu, 28 Jan 2021 15:58:23 +0100 Subject: [PATCH] Fix broken rendering in case of Array with +oneOf+ If the schemas provided inside `oneOf` of array items is not a `ref`, the rendering fails because it tries `.upcase` on an `Integer`. --- lib/prmd/templates/schemata/helper.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prmd/templates/schemata/helper.erb b/lib/prmd/templates/schemata/helper.erb index 03be9869..029e123f 100644 --- a/lib/prmd/templates/schemata/helper.erb +++ b/lib/prmd/templates/schemata/helper.erb @@ -59,7 +59,7 @@ oneof_name = ref ? ref.split('/').last : index nested = extract_attributes(schema, oneof_definition['properties']) nested.each do |attribute| - attribute[0] = "#{key}/[#{oneof_name.upcase}].#{attribute[0]}" + attribute[0] = "#{key}/[#{oneof_name.to_s.upcase}].#{attribute[0]}" end attributes.concat(nested) end