New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global documentation data #99

Closed
fabiomaffioletti opened this Issue Feb 23, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@fabiomaffioletti
Copy link
Owner

fabiomaffioletti commented Feb 23, 2015

Manage documentation that is valid across the whole API, for example:

  • in this app, GET means retrieving a list of resources or a single resource
  • in this app, every request should have header "x" with value "y"
  • ...
@djpotter77

This comment has been minimized.

Copy link

djpotter77 commented Apr 24, 2015

It seems like you can already do some of this with in the API description (albeit in a free-form manner).

However, I would really like to see a version of the ApiHeaders and ApiErrors annotations that could be applied at either the controller class level or even a higher level class associated with an entire API group. Having to repeat all common headers and errors explicitly for every method is a chore, error prone, and really bloats the controller code.

@djpotter77

This comment has been minimized.

Copy link

djpotter77 commented Apr 29, 2015

Although it wouldn't allow truly global headers and errors, it would be pretty simple to allow the ApiHeaders and ApiErrors annotations at the class level so that you can define a set of default headers or errors that get added to any method-specific ones that are defined. I think it would just involve changing the annotations to allow ElementType.TYPE and updating the ApiHeaderDoc.build() and ApiErrorDoc.build() methods to merge the the class and method level annotations.

@fabiomaffioletti

This comment has been minimized.

Copy link
Owner Author

fabiomaffioletti commented Aug 4, 2015

@djpotter77 with version 1.1.16 it is possible to add the @ApiHeaders annotation at class level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment