Skip to content

Allow markdown docs to be inserted in the generated blueprint #8

@petrbela

Description

@petrbela

So, we have this idea for the ideal workflow:

  1. Write your request specs
  2. Run your request specs and the whole apib file will be generated for you

There are two things missing to get to this state:

  • copy markdown docs to the generated txt (or better .md)
  • concat generated files to one apib file (will open another issue)

I can imagine the docs would either be in the source file (controller) or spec file. I'd probably go with the spec file as it will keep the information in one place, and also implementation will be easier.

The gem should copy the markdown docs from comments and place them in the generated file.

# Arena represents a combat room.
#
# Attributes:
#
# - `name` - arena name
# - `owner` - user who created the arena
describe 'Arenas Requests' do

  # Fetch information about an arena.
  describe 'GET /v1/arenas/{id}' do
    it 'responds with the requested arena' do
      arena = create :arena, foursquare_id: '5104'
      get v1_arena_path(arena)

      response.status.should eq(200)
    end
  end

end

Would generate

# Group Arenas
Arena represents a combat room.

Attributes:

- `name` - arena name
- `owner` - user who created the arena

## GET /v1/arenas/{id}
Fetch information about an arena.

+ Response 200 (application/json)

    {
      "arena": {
        "id": "4e9dbbc2-830b-41a9-b7db-9987735a0b2a",
        "name": "Clinton St. Baking Co. & Restaurant",
        "latitude": 40.721294,
        "longitude": -73.983994,
        "foursquare_id": "5104"
      }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions