Document response status with Spring REST Docs -


i'm using spring rest docs generate documentation restful service, , want generate table of possible values of response status descriptions, it's done here(in bottom of page).

i can manually in parent index.adoc file, includes generated ones, don't since makes documentation spilled apart although want keep whole signature description in single place.

i've read rest docs documentation , searched on stackoverflow , project's github issues, haven't seen mention of such feature.

am missing something, or feature i'm looking not implemented , not needed?

the feature you're looking not implemented and, in opinion, isn't needed.

when you're developing , documentation restful api, should try make api consistent possible in how uses http status codes , should use standard, well-understood meanings of each status. if follow these 2 guidelines can either avoid documenting status code altogether, or can document them once in overview section.

the documentation you've linked provides few examples of don't think should do:

  1. it documents 200 means request successful. that's standard meaning of 200 response documentation adds little
  2. 402 used blocked api key means payment required. 403 (forbidden) response may have been more appropriate
  3. it abuses 404 (not found) indicate rate limit has been exceeded

in short, making non-standard use of http status codes has meant need documented. if non-standard use varies resource resource, it's meant need documented every resource.

if avoid making mistakes described above can save work , make things easier users @ same time.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -