File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 274274 additionalProperties : false
275275 } )
276276 end
277-
278- it "supports reference to the root schema" do
279- schema_class . define :ui_element do
280- string :element_type , enum : [ "input" , "button" ]
281- string :label
282- object :sub_schema , reference : :root
283- end
284-
285- instance = schema_class . new
286- json_output = instance . to_json_schema
287-
288- expect ( json_output [ :schema ] [ :properties ] [ :ui_schema ] [ :properties ] [ :sub_schema ] ) . to eq ( { "$ref" => "#" } )
289- end
290277 end
291278
292279 # ===========================================
326313 user_props = json_output [ :schema ] [ :properties ] [ :user ] [ :properties ]
327314 expect ( user_props [ :addresses ] [ :items ] ) . to eq ( { "$ref" => "#/$defs/address" } )
328315 end
316+
317+ it "supports reference to the root schema" do
318+ schema_class . string :element_type , enum : [ "input" , "button" ]
319+ schema_class . string :label
320+ schema_class . object :sub_schema , reference : :root
321+
322+ instance = schema_class . new
323+ json_output = instance . to_json_schema
324+
325+ expect ( json_output [ :schema ] [ :properties ] [ :sub_schema ] ) . to eq ( { "$ref" => "#" } )
326+ end
329327 end
330328
331329 # ===========================================
You can’t perform that action at this time.
0 commit comments