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:
- it documents 200 means request successful. that's standard meaning of 200 response documentation adds little
- 402 used blocked api key means payment required. 403 (forbidden) response may have been more appropriate
- 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
Post a Comment