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

Support for arrays as parameters #890

Closed
andymc12 opened this issue Aug 3, 2020 · 1 comment
Closed

Support for arrays as parameters #890

andymc12 opened this issue Aug 3, 2020 · 1 comment
Assignees
Milestone

Comments

@andymc12
Copy link
Contributor

andymc12 commented Aug 3, 2020

Section 3.2 says the following:

Valid parameter types for each of the above annotations are listed in
the corresponding Javadoc, however in general (excluding @Context) the
following types are supported:

  1. Types for which a ParamConverter is available via
    a registered ParamConverterProvider. See Javadoc for these classes for
    more information.
  2. Primitive types.
  3. Types that have a constructor that accepts a single
    String argument.
  4. Types that have a static method named valueOf or
    fromString with a single String argument that return an instance of
    the type. If both methods are present then valueOf MUST be used unless
    the type is an enum in which case fromString MUST be usedfootnote:[Due
    to limitations of the built-in valueOf method that is part of all Java
    enumerations, a fromString method is often defined by the enum
    writers. Consequently, the fromString method is preferred when
    available.].
  5. List<T>, Set<T>, or SortedSet<T>, where T satisfies
    1,3 or 4 above.

It seems like we should support array types in places where we support List types (e.g. @CookieParam, @FormParam, @HeaderParam, @MatrixParam, and @QueryParam - @BeanParam and @PathParam do not support Lists, so should not support arrays either).

The MicroProfile Metrics community incorrectly assumed that arrays were already supported (see conversation here: https://groups.google.com/forum/#!topic/microprofile/yxoelXvk3o8 ).

Arrays already seem to be supported in Apache CXF and RESTEasy. I have not tested Jersey, but I assume that they are not supported based on the MP Metrics conversation.

If nobody objects, I can open a PR to update the spec text and Javadoc. Since this changes behavior, it would need to be released post-EE9.

@mkarg
Copy link
Contributor

mkarg commented Aug 3, 2020

Sounds reasonable. Thank your for bringing this forward.

andymc12 added a commit to andymc12/jaxrs-api that referenced this issue Aug 3, 2020
@andymc12 andymc12 self-assigned this Aug 3, 2020
@andymc12 andymc12 added this to the 3.1 milestone Aug 3, 2020
andymc12 added a commit to andymc12/jaxrs-api that referenced this issue Aug 4, 2020
andymc12 added a commit that referenced this issue Aug 18, 2020
[#890] All array types to be used as parameters
mkarg pushed a commit to mkarg/rest that referenced this issue Nov 10, 2020
mkarg pushed a commit to mkarg/rest that referenced this issue Nov 11, 2020
mkarg pushed a commit to mkarg/rest that referenced this issue Nov 11, 2020
mkarg pushed a commit that referenced this issue Nov 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants