Skip to content

Add support for annotating parameters #1002

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

Closed
mattyb678 opened this issue Sep 11, 2019 · 3 comments
Closed

Add support for annotating parameters #1002

mattyb678 opened this issue Sep 11, 2019 · 3 comments
Assignees
Labels
theme: code-generation Issues related to code generation type: enhancement
Milestone

Comments

@mattyb678
Copy link
Contributor

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.

@snicoll snicoll changed the title Cannot add Annotation to Parameter Add support for annotating parameters Sep 12, 2019
@snicoll
Copy link
Contributor

snicoll commented 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 snicoll added the status: waiting-for-feedback We need additional information before we can continue label Sep 12, 2019
@mattyb678
Copy link
Contributor Author

@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.

@snicoll
Copy link
Contributor

snicoll commented Sep 12, 2019

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.

@snicoll snicoll added for: team-attention and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 12, 2019
@snicoll snicoll added the theme: code-generation Issues related to code generation label Jun 8, 2023
@snicoll snicoll self-assigned this Jun 12, 2023
@snicoll snicoll added this to the 0.20.0 milestone Jun 12, 2023
@snicoll snicoll mentioned this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: code-generation Issues related to code generation type: enhancement
Projects
None yet
Development

No branches or pull requests

2 participants