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
There are cases when a parameter needs to have an annotation. It seems like an easy fix, Parameter just needs to implement Annotatable. There may be some work to make the various SourceCodeWriters write the annotations for parameters.
The text was updated successfully, but these errors were encountered:
snicoll
changed the title
Cannot add Annotation to Parameter
Add support for annotating parameters
Sep 12, 2019
@mattyb678 what's the use case? I am trying to avoid putting too much in the model and see if folks wouldn't be happy with something a bit more pragmatic for "advanced use cases".
@snicoll The 2 uses cases that I was running into were adding OpenAPI Parameter annotation and the second would be jax-rs (QueryParam, PathParam, etc) or SpringMVC (RequestParam, PathVariable, etc.). I'm open to a different approach, it just seemed that since annotations could be added to classes, methods, and fields that making parameters annotatable would make sense.
Absolutely. I don't think that's an easy fix as it brings additional potential problems, e.g. handling indentation or potential very long lines in case you have several annotations and several parameters. The point I was trying to make was that the initial plan was to keep this model as simple as possible and tailored for our use cases. I am happy to open it up as long as those side effects are taken into account.
There are cases when a parameter needs to have an annotation. It seems like an easy fix, Parameter just needs to implement Annotatable. There may be some work to make the various SourceCodeWriters write the annotations for parameters.
The text was updated successfully, but these errors were encountered: