malachheb / calamum Goto Github PK
View Code? Open in Web Editor NEWRest Api documentation generator
Rest Api documentation generator
Because resources are stored as a dictionary, regenerating the documentation from the same YAML file does not result in consistent output. It would be nice if they remained in the same order across re-runs (alphabetically?).
I have tried to add header by different ways but could not succeed, can you please tell me how can i added header to API documentation.
Accept: application/vnd.example.v1
Content-Type: application/json
"header": {
"Accept": {
"type": "string",
"description": "application/vnd.example.v1",
"required": true
},
"Content-Type": {
"type": "string",
"description": "application/json",
"required": true
}
},
Run this command
calamum -f myapi.json -t twitter
return [ERROR] undefined method `each' for nil:NilClass
Can the description of a POST (or PUT) be a JSON document, instead of a set of params?
In doc_parser.rb, we put each resource into a Hash.
Ln 5 "@resources = Hash.new"
then in the twitter template, we read it by
Ln 32 "<% @resources.each do |name, endpoints| %>"
which can't ensure read resources in sequence.
what about reading it by:
<% @resources.sort.map do |name, endpoints| %> ?
It would be interesting if this gem could also handle the resources in smaller files. For instance, if the resources could be separate json files.
On a fresh RVM 1.9.3 install in Ubuntu 12.04 after running gem install calamum
.
$> calamum
/home/vagrant/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- pry (LoadError)
from /home/vagrant/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/gems/calamum-1.1.0/lib/calamum.rb:5:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/gems/calamum-1.1.0/lib/calamum/runner.rb:1:in `<top (required)>'
from /home/vagrant/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/gems/calamum-1.1.0/bin/calamum:8:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/bin/calamum:23:in `load'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/bin/calamum:23:in `<main>'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `eval'
from /home/vagrant/.rvm/gems/ruby-1.9.3-p484/bin/ruby_executable_hooks:15:in `<main>'
After running gem install pry
calamum works as expected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.