apiaryio / api-blueprint

API Blueprint
https://apiblueprint.org
MIT License
8.64k stars 2.14k forks source link

SLA Section Request #321

Closed peter-quinton closed 5 years ago

peter-quinton commented 8 years ago

Feature Request: A section that you can put a service level agreement into. This would be ideally be a child of the "Action" section.

My apologies if this is the wrong place for a feature request.

zdne commented 8 years ago

Can't you just put the SLA notice in the Action's description like so:

# My Resource [/r]

## Action A [GET]
Lorem Ipsum.

### SLA
SLA Ipsum.

- Response 200
peter-quinton commented 8 years ago

Thank you for your response, I tried your suggestion and aglio renders that perfectly, however protaganist puts it into a element of type copy. I was hoping to be able to use the SLA datastructure programatically...

If I use an Attributes section with an object body (not MSON) it shows up under en element type of dataStructure in the content.meta property. However, it doesn't render for humans using aglio.

{
  "attributes": {
    "data": {
      "element": "dataStructure",
      "content": [
        {
          "element": "object",
          "meta": {
            "description": "        {\n          \"SLA\": {\n            \"NRappName\": \"hello\",\n            \"endpiont\": \"/ships/{shipId}\",\n            \"verb\": \"GET\",\n            \"responseTime\": 250,\n            \"rps\": 500\n          }\n        }\n"
          }
        }
      ]
    }
  }
}

If I could use it programmatically and have it render via aglio that would be ideal. If you have any other suggestions I'd love to see them.

zdne commented 8 years ago

Gotcha. I would say that the only way to process this right now is to introspect every copy element.

kylef commented 5 years ago

There's an open issue regarding Aglio's lack oif rendering for data structures (https://github.com/danielgtaylor/aglio/issues/103) unfortunately Aglio isn't that maintaned these days (https://github.com/danielgtaylor/aglio/commit/0cef09ab83d680689bcadf53aa45fc7bca3b5af3) so I think it is unlikely this will move much. However there are some alternative API Documentation generators from API Blueprint that have came along, and there is the Apiary documentation rendered which support rendering data structures.