Skip to content

Fix Bean Param Enum Imports #187

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

Merged
merged 8 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions http-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,12 @@
<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-inject</artifactId>
<version>8.13</version>
<version>9.0-RC3</version>
<optional>true</optional>
</dependency>

<!-- test dependencies -->

<!-- <dependency>-->
<!-- <groupId>io.avaje</groupId>-->
<!-- <artifactId>avaje-slf4j-jpl</artifactId>-->
<!-- <version>1.1</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

<dependency>
<groupId>io.avaje</groupId>
<artifactId>avaje-applog-slf4j</artifactId>
Expand Down Expand Up @@ -97,15 +90,6 @@
<version>1.1</version>
<scope>test</scope>
</dependency>

<!-- test annotation processors -->
<!-- <dependency>-->
<!-- <groupId>io.avaje</groupId>-->
<!-- <artifactId>avaje-inject-generator</artifactId>-->
<!-- <version>8.6</version>-->
<!-- <scope>test</scope>-->
<!-- </dependency>-->

</dependencies>

<build>
Expand Down Expand Up @@ -134,19 +118,6 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M6</version>
<!-- <configuration>-->
<!-- <argLine>-->
<!-- &#45;&#45;add-modules com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-modules io.avaje.jsonb-->
<!-- &#45;&#45;add-opens io.avaje.http.client/io.avaje.http.client=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.webserver=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=ALL-UNNAMED-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.webserver=com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=com.fasterxml.jackson.databind-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=io.avaje.jsonb-->
<!-- &#45;&#45;add-opens io.avaje.http.client/org.example.github=io.avaje.inject-->
<!-- </argLine>-->
<!-- </configuration>-->
</plugin>

</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TypeHandler initTypeHandler() {
!isCollection && typeOp.filter(t -> t.mainType().startsWith("java.util.Map")).isPresent();

if (mainTypeEnum) {
return TypeMap.enumParamHandler(type);
return TypeMap.enumParamHandler(typeOp.orElseThrow());
} else if (isCollection) {
this.isParamCollection = true;
final var isEnumCollection =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package org.example.myapp.web;

import java.util.List;
import java.util.Set;

import javax.validation.Valid;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import io.avaje.http.api.Header;
import io.avaje.http.api.QueryParam;
import io.avaje.jsonb.Json;

@Json
Expand All @@ -23,8 +25,10 @@ public class GetBeanForm {
private String email;

private List<String> addresses;
@Header
private String head;

@Header private String head;

@QueryParam private Set<ServerType> type;

public String getName() {
return name;
Expand Down Expand Up @@ -67,4 +71,12 @@ public String getHead() {
public void setHead(String head) {
this.head = head;
}

public Set<ServerType> getType() {
return type;
}

public void setType(Set<ServerType> type) {
this.type = type;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ void get_validate_bean_expect422() {
final HttpResponse<String> hres = client.request()
.path("hello/withValidBean")
.queryParam("email", "user@foo.com")
.queryParam("type", "PROXY")
.GET()
.asString();

Expand All @@ -253,6 +254,7 @@ void get_validate_bean_expect200() {
.path("hello/withValidBean")
.queryParam("name", "hello")
.queryParam("email", "user@foo.com")
.queryParam("type", "PROXY")
.GET()
.asString();

Expand Down