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
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:
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:
Adding a new snippet with just the response headers and no body.
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.
The text was updated successfully, but these errors were encountered:
Using tags in the snippets is an interesting idea. Thanks.
In the meantime, I typically use a pre-processor to change the body of the response to something that's better-suited to being documented. For example:
wilkinsona
changed the title
Feature request: add tags to documentation or split response headers from body
Tag regions of Asciidoctor snippets to allow their contents to be selectively included
Mar 27, 2018
@wilkinsona thanks for the advice, sadly the tags and line solution isn't actually as useful as I first considered. Because the snippet contains the formatting
[source,http,options="nowrap"]
----
and
----
the solution is a little ugly. I'd have to manually include the leading lines and final line or do the include and manually type the formatting around it.
You can include multiple tags in a single include, so I think your idea still warrants some investigation. I'm not sure what the tag for the "surrounding stuff" should be called, but this doesn't seem too awkward:
include::http-response.rb[tags=stuff;headers]
That said, this will only benefit those who are using Asciidoctor. Perhaps separate snippets for the HTTP request and response that just contain the headers are in order. That would provide a nice symmetry with the existing snippets that just contain the HTTP request body and HTTP response body.
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:
Sadly, the automatically generated snippets are:
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:
tagged regions
as seen here: https://asciidoctor.org/docs/user-manual/#by-tagged-regions which would allow thehttp-response.adoc
to potentially include tags for the headers and body which could then improve how I can include just the headers.The text was updated successfully, but these errors were encountered: