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
This commit adds API Blueprint (APIB) to this gem. A few highlights:
* APIB groups entities, resources, routes, HTTP verbs and requests
differently than what the gem currently uses. Because of that I had to
override more methods than usual in the `Markup` classes.
APIB has the following structure:
1. resource (e.g "Group Orders")
2. route (e.g "Orders Collection [/orders]")
3. HTTP method (e.g "Loads all orders [GET]")
4. Requests. Here, we show all different requests which means that
we don't have the repetition of GET for each example. All
examples stay under one, unified HTTP method header.
* APIB differentiates parameters (values used in the URLs) from
attributes (values used in the actual request body). You can use
`attributes` in your texts.
* APIB has a `route` header, which means we had to add a new RSpec block
called `route()` which wraps HTTP methods, like the following:
```ruby
route "/orders", "Orders Collection" do
get "Returns all orders" do
# ...
end
delete "Deletes all orders" do
# ...
end
end
```
If you don't use `route`, then param in `get(param)` should be an URL.
* APIB is not navigable like HTML, so generating an index file makes no
sense. Because of that, we are generating just one file, `index.apib`.
* We are omitting some APIB features in this version so we can get up
and running sooner. Examples are object grouping, arrays objects and a
few description points.
Unrelated to APIB:
* FakeFS was being used _globally_ in test mode, which means that
nothing would load file systems, not even a simple `~/.pry_history`, which
made debugging impossible. I moved the usage of this gem to the places
where it is used.
Closes#235.
0 commit comments