You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I use your code to document the swagger model - I can't really get it to work. The representer shows up in the grape documentation but both type and description are missing for the defined properties…
Update: Got it! The documentation method has to look like this (the documentation values are stored under attribute[:documentation]):
def documentation
Hash[representable_attrs.map do |attribute|
property_name = attribute[:as].evaluate nil, nil
next if property_name == '_links'
[property_name, {desc: attribute[:documentation][:desc], type: attribute[:documentation][:type]}]
end.compact]
end
Grape exposures give you
entity_name
,exposures
anddocumentation
. We can add those for out-of-the-box support for https://github.com/tim-vandecasteele/grape-swagger.The text was updated successfully, but these errors were encountered: