Skip to content

Tag regions of Asciidoctor snippets to allow their contents to be selectively included #495

Open
@davidgoate

Description

@davidgoate

When documenting some endpoint which returns protobuf format, I'd find it useful to be able to document the response headers without the body. Currently this is what I get:

HTTP/1.1 200 OK
Content-Type: application/x-protobuf
X-Protobuf-Schema: proto1.proto
X-Protobuf-Message: com.org.project.Proto1
Content-Length: 226


��
�GBP���"�33.31*�
�GBP���2
�GBP����

Sadly, the automatically generated snippets are:

  • curl-request.adoc
  • http-request.adoc
  • http-response.adoc
  • httpie-request.adoc
  • request-body.adoc
  • response-body.adoc

Note that there is not one that includes just the response headers without the body. I can work around this in a slightly hacky way by doing my include like this include::filename.txt[lines=0..5] however, obviously this is a little brittle if new headers should appear and I don't update this to include them (they will be chopped off).

I'd like to request as a feature either:

  1. Adding a new snippet with just the response headers and no body.
  2. Ascii doctors seems to support a concept of tagged regions as seen here: https://asciidoctor.org/docs/user-manual/#by-tagged-regions which would allow the http-response.adoc to potentially include tags for the headers and body which could then improve how I can include just the headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementEnhancement that adds a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions