Skip to content

Commit

Permalink
Remove mapping @RegisterForReflection
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed Apr 26, 2024
1 parent 5e230ab commit 3132581
Show file tree
Hide file tree
Showing 5 changed files with 252 additions and 65 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

import java.util.Optional;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
public interface Alias extends Named {
@JsonProperty
Optional<String> alias();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

import java.util.Optional;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkus.runtime.annotations.RegisterForReflection;

@RegisterForReflection
public interface Named {
@JsonProperty
Optional<String> name();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

import org.eclipse.microprofile.config.spi.Converter;

import com.fasterxml.jackson.annotation.JsonProperty;

import io.quarkus.runtime.annotations.RegisterForReflection;
import io.quarkus.runtime.configuration.DurationConverter;
import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithConverter;
Expand All @@ -25,100 +22,72 @@
import io.smallrye.config.WithParentName;

@ConfigMapping(prefix = "http.server")
@RegisterForReflection
public interface Server extends Alias {
@JsonProperty
String host();

@JsonProperty
@Min(8000)
int port();

@JsonProperty
@WithConverter(DurationConverter.class)
Duration timeout();

@JsonProperty
@WithName("io-threads")
int threads();

@WithConverter(ByteArrayConverter.class)
byte[] bytes();

@JsonProperty
@WithParentName
Map<String, Form> form();

@JsonProperty
Optional<Ssl> ssl();

@JsonProperty
Optional<Proxy> proxy();

@JsonProperty
Optional<Cors> cors();

@JsonProperty
Log log();

@JsonProperty
Info info();

@RegisterForReflection
interface Form {
@JsonProperty
String loginPage();

@JsonProperty
String errorPage();

@JsonProperty
String landingPage();

@JsonProperty
Optional<String> cookie();

@JsonProperty
@WithDefault("1")
List<Integer> positions();
}

@RegisterForReflection
interface Proxy {
@JsonProperty
boolean enable();

@JsonProperty
@Max(10)
int timeout();
}

@RegisterForReflection
interface Log {
@JsonProperty
@WithDefault("false")
boolean enabled();

@JsonProperty
@WithDefault(".log")
String suffix();

@JsonProperty
@WithDefault("true")
boolean rotate();

@JsonProperty
@WithDefault("COMMON")
Pattern pattern();

@JsonProperty
Period period();

@JsonProperty
@Max(15)
int days();

@RegisterForReflection
enum Pattern {
COMMON,
SHORT,
Expand All @@ -127,47 +96,33 @@ enum Pattern {
}
}

@RegisterForReflection
interface Cors {
@JsonProperty
List<Origin> origins();

@JsonProperty
List<@Size(min = 2) String> methods();

@RegisterForReflection
interface Origin {
@JsonProperty
@Size(min = 5)
String host();

@JsonProperty
@Min(8000)
int port();
}
}

@RegisterForReflection
interface Info {
@JsonProperty
Optional<@Size(max = 3) String> name();

@JsonProperty
@Max(3)
OptionalInt code();

@JsonProperty
Optional<List<@Size(max = 3) String>> alias();

@JsonProperty
Map<String, List<Admin>> admins();

@JsonProperty
Map<String, List<@Size(min = 8, max = 15) String>> firewall();

@RegisterForReflection
interface Admin {
@JsonProperty
@Size(max = 4)
String username();
}
Expand Down
Loading

0 comments on commit 3132581

Please sign in to comment.