Skip to content

Commit

Permalink
EES-5494 Link to enum schemas when rendering enum types
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsim committed Sep 8, 2024
1 parent 368e5d3 commit b938796
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/api_reference_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,23 +106,23 @@ def render_schema_type(schema)
return "array"
end

if items.type == "object" && items.name
href = ::Middleman::Util::url_for(@app, "/schemas/#{items.name}/index.html", {
"array (#{render_schema_type(items)})"
else
if schema.name
href = ::Middleman::Util::url_for(@app, "/schemas/#{schema.name}/index.html", {
current_resource: current_resource
})

"array (<a href='#{href}'>#{items.name}</a>)"
"<a href='#{href}'>#{schema.name}</a>"
else
"array (#{render_schema_type(items)})"
end
else
# Make assumption that all oneOf items are same type as
# Swashbuckle theoretically shouldn't allow different types.
if schema.all_of&.any?
return render_schema_type(schema.all_of[0])
end
# Make assumption that all oneOf items are same type as
# Swashbuckle theoretically shouldn't allow different types.
if schema.all_of&.any?
return render_schema_type(schema.all_of[0])
end

schema.type || "any"
schema.type || "any"
end
end
end

Expand Down

0 comments on commit b938796

Please sign in to comment.