Slide 13
Slide 13 text
PAGE
# MOONGIFT / 29
DAY 2018/11/09
Document in Code
• Connecting code and document
• Too much comment in code for
documentation
• Programmer is NOT necessarily able
to write high readability document
• Most document generators don’t
support i18n.
13
desc 'Returns your public timeline.' do
summary 'summary'
detail 'more details'
params API::Entities::Status.documentation
success API::Entities::Entity
failure [[401, 'Unauthorized', 'Entities::Error']]
named 'My named route'
headers XAuthToken: {
description: 'Validates your identity',
required: true
},
XOptionalHeader: {
description: 'Not really needed',
required: false
}
hidden false
deprecated false
is_array true
nickname 'nickname'
produces ['application/json']
consumes ['application/json']
tags ['tag1', 'tag2']
end
get :public_timeline do
Status.limit(20)
end