Navigation Menu

Skip to content
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
Closed

Global documentation data #99

fabiomaffioletti opened this issue Feb 23, 2015 · 3 comments
Assignees
Milestone

Comments

@fabiomaffioletti
Copy link
Owner

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
Copy link

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
Copy link

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
Copy link
Owner Author

@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
Projects
None yet
Development

No branches or pull requests

2 participants