在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:technekes/grape-slate开源软件地址:https://github.com/technekes/grape-slate开源编程语言:Ruby 88.8%开源软件介绍:GrapeSlateAuto generates an Slate Document from the docuementation that is created by your Grape API. NOTEThis is an early implementation that makes some assumptions about your API (follows a standard REST pattern) that works with our implementation of Grape API's. There is a new an unreleased feature in Grape that allows for appending additional documentation. This project is dependent on this feature in order to create example JSON requests and responses. InstallationAdd this line to your application's Gemfile:
And then execute:
Or install it yourself as:
UsageAdd some metadata about your API and then execute the ConfigurationConfigure details about your api in an initializers or similar: GrapeSlate.config do |config|
# the name of your api
config.name = 'Awesome API'
# a description for your api
config.description = 'The awesome description'
# the type to use for generated sample id's (`integer` or `uuid`)
config.example_id_type = :uuid
# resources you do not want documented
config.resource_exclusion = [:admin, :swagger_doc]
# whether or not examples should include a root element (default: false)
config.include_root = true
end
# request headers you want documented
GrapeSlate.config.request_headers = [
{ 'Accept-Charset' => 'utf-8' },
{ 'Connection' => 'keep-alive' }
]
# response headers you want documented
GrapeSlate.config.response_headers = [
{ 'Content-Length' => '21685' },
{ 'Connection' => 'keep-alive' }
] Generation# supply the class you'd like to document and generate your blueprint
GrapeSlate::Document.new(AwesomeAPI).generate TODO
Contributing
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论