fix: register persisted model types for native-image reflection (#1781)

An audit found 69 types reachable from StorageFactory persistence
still unregistered after #1695: iot (all 10 persisted roots),
cloudfront (20), apigateway (13), route53 (7), transfer (4), appsync
enums (6), plus nested inner types file-level sweeps miss (memorydb
Endpoint, Secret$RotationRules/$Tag, KinesisShard ranges,
IotPolicy$PolicyVersion). Native-image builds failed to deserialize
their persisted state on restart.

Adds PersistedModelReflectionTest, a classpath-scan guard that
discovers every persistence-root TypeReference<Map<String,V>>, walks
V's reachable field graph, and fails listing any type missing
@RegisterForReflection (direct or via targets=).

Refs #1695
This commit is contained in:
Hector Ventura authored and GitHub committed 2026-07-08 22:19:00 -05:00
1 parent 959eb16700
commit de13017cd3
66 files changed
+395

No files matched your search

@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class Account {
private String apiKeyVersion = "4";
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.HashMap;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class ApiGatewayResource {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public record Deployment(
String id,
String description,
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.ArrayList;
import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class EndpointConfiguration {
private List<EndpointType> types = new ArrayList<>();
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum EndpointType {
REGIONAL,
EDGE,
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.HashMap;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class Integration {
private String type; // MOCK, HTTP, AWS, HTTP_PROXY, AWS_PROXY
@@ -1,10 +1,13 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public record IntegrationResponse(
String statusCode,
String selectionPattern,
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.HashMap;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class MethodConfig {
private String httpMethod;
@@ -1,10 +1,13 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public record MethodResponse(
String statusCode,
Map<String, Boolean> responseParameters
@@ -1,5 +1,7 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
@@ -14,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
* mean "no override").
*/
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class MethodSetting {
private static final int UNSET_THROTTLING_BURST_LIMIT = -1;
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.HashMap;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class RestApi {
private String id;
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.HashMap;
import java.util.Map;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class Stage {
private String stageName;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.apigateway.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
@RegisterForReflection
public class ThrottleSettings {
private Integer burstLimit = 5000;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.appsync.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum AuthenticationType {
API_KEY,
AWS_IAM,
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.appsync.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum DataSourceType {
NONE,
AWS_LAMBDA,
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.appsync.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum ResolverKind {
UNIT,
PIPELINE
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.appsync.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum ResolverRuntimeName {
APPSYNC_JS,
VTL
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.appsync.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum SchemaCreationStatusType {
PROCESSING,
ACTIVE,
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.appsync.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public enum TypeFormat {
SDL,
JSON
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class CacheBehavior {
private String pathPattern;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.Map;
@RegisterForReflection
public class CachePolicy {
private String id;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class CloudFrontFunction {
private String name;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class CloudFrontOriginAccessIdentity {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.List;
@RegisterForReflection
public class ContinuousDeploymentPolicy {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class DefaultCacheBehavior {
private String targetOriginId;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.Map;
@RegisterForReflection
public class Distribution {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class DistributionConfig {
private String callerReference;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class FieldLevelEncryptionConfig {
private String id;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class FieldLevelEncryptionProfile {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.List;
@RegisterForReflection
public class Invalidation {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.List;
@RegisterForReflection
public class KeyGroup {
private String id;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class MonitoringSubscription {
private String distributionId;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class Origin {
private String id;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class OriginAccessControl {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.Map;
@RegisterForReflection
public class OriginRequestPolicy {
private String id;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class PublicKey {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class RealtimeLogConfig {
private String arn;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.Map;
@RegisterForReflection
public class ResponseHeadersPolicy {
private String id;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.cloudfront.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.List;
@RegisterForReflection
public class StreamingDistribution {
private String id;
@@ -1,5 +1,7 @@
package io.github.hectorvent.floci.services.cognito.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -7,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Information about a revoked token for tracking and validation purposes.
* Used to implement AWS Cognito AdminUserGlobalSignOut token revocation behavior.
*/
@RegisterForReflection
public class RevokedTokenInfo {
private final String jti;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.Map;
import java.util.TreeMap;
@RegisterForReflection
public class IotCertificate {
private String certificateId;
private String certificateArn;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
@RegisterForReflection
public class IotJob {
private String jobId;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
@RegisterForReflection
public class IotJobExecution {
private String jobId;
@@ -1,11 +1,14 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
@RegisterForReflection
public class IotPolicy {
private String policyName;
private String policyArn;
@@ -30,6 +33,7 @@ public class IotPolicy {
public Map<String, String> getTags() { return tags == null ? Map.of() : tags; }
public void setTags(Map<String, String> tags) { this.tags = tags == null ? new TreeMap<>() : new TreeMap<>(tags); }
@RegisterForReflection
public static class PolicyVersion {
private String versionId;
private String document;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class IotRetainedMessage {
private String topic;
private String payload;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class IotShadow {
private String thingName;
private String shadowName;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
@RegisterForReflection
public class IotThingGroup {
private String thingGroupName;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
@RegisterForReflection
public class IotThingType {
private String thingTypeName;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.Map;
import java.util.TreeMap;
@RegisterForReflection
public class IotTopicRule {
private String ruleName;
private String ruleArn;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.iot.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.HashMap;
import java.util.Map;
@RegisterForReflection
public class Thing {
private String thingName;
@@ -51,6 +51,9 @@ public class KinesisShard {
public Instant getCreationTimestamp() { return creationTimestamp; }
public void setCreationTimestamp(Instant timestamp) { this.creationTimestamp = timestamp; }
@RegisterForReflection
public record HashKeyRange(String startingHashKey, String endingHashKey) {}
@RegisterForReflection
public record SequenceNumberRange(String startingSequenceNumber, String endingSequenceNumber) {}
}
@@ -1,3 +1,6 @@
package io.github.hectorvent.floci.services.memorydb.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public record Endpoint(String address, int port) {}
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class AliasTarget {
private String hostedZoneId;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class ChangeInfo {
private String id;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class HealthCheck {
private String id;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class HealthCheckConfig {
private String type;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class HostedZone {
private String id;
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class ResourceRecord {
private String value;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.route53.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
@RegisterForReflection
public class ResourceRecordSet {
private String name;
@@ -1,3 +1,6 @@
package io.github.hectorvent.floci.services.s3.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public record ObjectLockRetention(String mode, String unit, int value) {}
@@ -29,6 +29,7 @@ public class Secret {
private Instant lastRotatedDate;
private Instant nextRotationDate;
@RegisterForReflection
public record RotationRules(
@JsonProperty("AutomaticallyAfterDays") Integer automaticallyAfterDays,
@JsonProperty("Duration") String duration,
@@ -38,6 +39,7 @@ public class Secret {
public Secret() {
}
@RegisterForReflection
public record Tag(
@JsonProperty("Key") String key,
@JsonProperty("Value") String value) {
@@ -1,5 +1,8 @@
package io.github.hectorvent.floci.services.transfer.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
@RegisterForReflection
public class HomeDirectoryMapping {
private String entry;
@@ -1,9 +1,12 @@
package io.github.hectorvent.floci.services.transfer.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class Server {
private String serverId;
@@ -1,7 +1,10 @@
package io.github.hectorvent.floci.services.transfer.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.time.Instant;
@RegisterForReflection
public class SshPublicKey {
private String sshPublicKeyId;
@@ -1,8 +1,11 @@
package io.github.hectorvent.floci.services.transfer.model;
import io.quarkus.runtime.annotations.RegisterForReflection;
import java.util.List;
import java.util.Map;
@RegisterForReflection
public class User {
private String userName;