Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api Blueprint format #235

Closed
sashazykov opened this issue Oct 8, 2015 · 8 comments
Closed

Api Blueprint format #235

sashazykov opened this issue Oct 8, 2015 · 8 comments
Assignees

Comments

@sashazykov
Copy link

Please, add api blueprint output format. The specification can be found here - https://apiblueprint.org/

@ceritium
Copy link

ceritium commented Oct 8, 2015

Hi, I am working for support swagger, probably you could use https://apitransformer.com/ for transform the outoput.

Related: #216

@sashazykov
Copy link
Author

@ceritium great! thank you for the link

@ceritium
Copy link

@sashazykov
Copy link
Author

@ceritium no. Thank you, will check it

@sashazykov
Copy link
Author

@ceritium btw apitransformer didn't help. I tried to convert from I/O Docs format to Blueprint and got an error.

@ceritium
Copy link

@AlexandrZ I mean use the swagger output and transform it to blueprint.

@oestrich
Copy link
Contributor

Echoing my comments from #216, I'll merge a PR that adds support of Api Blueprint. I don't use it so I have no intentions of adding support myself.

@kurko kurko self-assigned this Nov 4, 2016
@kurko
Copy link
Contributor

kurko commented Nov 7, 2016

I'm working on this. The caveat here is that BlueprintAPI is not navigable like HTML with index+page with details, therefore my plan is to have just one .apib file with the entire generated spec. I could build an HTML index pointing to the .apib files but usually we do want the entire spec in one single APIB file to be able to use all the tools it has around it (e.g dredd etc). PR coming.

kurko added a commit that referenced this issue Nov 16, 2016
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.
kurko added a commit that referenced this issue Nov 16, 2016
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.
kurko added a commit that referenced this issue Nov 16, 2016
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.
kurko added a commit that referenced this issue Dec 12, 2016
kurko added a commit that referenced this issue Dec 13, 2016
JSON requests should use UTF-8 by default according to
http://www.ietf.org/rfc/rfc4627.txt, so we will remove `charset=utf-8`
when we find it to avoid redundancy.

In the process, I moved code that was only used by APIB into the APIB
classes, such as exposing `content_type` to the templates. If I changed
the `content-type` for all templates it would break unrelated things.

Connects to #235.
kurko added a commit that referenced this issue Dec 14, 2016
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.
kurko added a commit that referenced this issue Dec 14, 2016
kurko added a commit that referenced this issue Dec 14, 2016
JSON requests should use UTF-8 by default according to
http://www.ietf.org/rfc/rfc4627.txt, so we will remove `charset=utf-8`
when we find it to avoid redundancy.

In the process, I moved code that was only used by APIB into the APIB
classes, such as exposing `content_type` to the templates. If I changed
the `content-type` for all templates it would break unrelated things.

Connects to #235.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants