What
PolicyTypes.PolicyCategory (src/main/java/com/getaxonflow/sdk/types/policies/PolicyTypes.java) is a closed enum with a @JsonValue getter only. The platform sends categories outside it: pdp/shipped_posture.json at enterprise 857455033 carries 14, five of which the enum lacks (security-dangerous, compliance-euaiact, dangerous_queries, pii_detection, sql_injection). A closed enum cannot represent a value this build does not know.
For 9.x the fix is additive, so nothing breaks on the release train:
- the enum gains the five constants;
- the read types keep the wire string, so a read-then-write round-trips byte-exact;
getCategory() returns the enum, or null for a category this build does not know;
getCategoryValue() is the lossless form;
- the builders gain a
category(String) overload.
The null from getCategory() is a temporary cost of staying source-compatible, not the design.
The 10.0.0 shape
Make PolicyCategory an open value class, on the pattern authzen.AuthZENObligationType already uses:
public static final constants for the known values;
PolicyCategory.of(String), with @JsonCreator, returning the constant or a carrier for an unknown value;
isKnown();
@JsonValue value();
equals and hashCode on the value.
An unknown category is then typed everywhere, in reads, requests and builders, instead of null, and the getCategoryValue() / category(String) pair from 9.x can be deprecated.
The change is source-breaking for callers that switch on the enum or use valueOf, values(), ordinal(), EnumSet or EnumMap. So it belongs in a major release. Inside the SDK the only enum-only uses today are four PolicyCategory.valueOf lines in MediaGovernanceTypesTest.
PolicyTier stays a closed enum: the platform constrains a static policy's tier to system, organization and tenant by a database CHECK (enterprise migrations/core/030_policy_tier_columns.sql:14 and :47).
Refs getaxonflow/axonflow-enterprise#4224 (the spec's category enum is staler than every SDK).
What
PolicyTypes.PolicyCategory(src/main/java/com/getaxonflow/sdk/types/policies/PolicyTypes.java) is a closed enum with a@JsonValuegetter only. The platform sends categories outside it:pdp/shipped_posture.jsonat enterprise857455033carries 14, five of which the enum lacks (security-dangerous,compliance-euaiact,dangerous_queries,pii_detection,sql_injection). A closed enum cannot represent a value this build does not know.For 9.x the fix is additive, so nothing breaks on the release train:
getCategory()returns the enum, or null for a category this build does not know;getCategoryValue()is the lossless form;category(String)overload.The null from
getCategory()is a temporary cost of staying source-compatible, not the design.The 10.0.0 shape
Make
PolicyCategoryan open value class, on the patternauthzen.AuthZENObligationTypealready uses:public static finalconstants for the known values;PolicyCategory.of(String), with@JsonCreator, returning the constant or a carrier for an unknown value;isKnown();@JsonValue value();equalsandhashCodeon the value.An unknown category is then typed everywhere, in reads, requests and builders, instead of null, and the
getCategoryValue()/category(String)pair from 9.x can be deprecated.The change is source-breaking for callers that
switchon the enum or usevalueOf,values(),ordinal(),EnumSetorEnumMap. So it belongs in a major release. Inside the SDK the only enum-only uses today are fourPolicyCategory.valueOflines inMediaGovernanceTypesTest.PolicyTierstays a closed enum: the platform constrains a static policy's tier tosystem,organizationandtenantby a database CHECK (enterprisemigrations/core/030_policy_tier_columns.sql:14and:47).Refs getaxonflow/axonflow-enterprise#4224 (the spec's category enum is staler than every SDK).