diff --git a/conjure-java-core/src/integrationInput/java/com/palantir/product/ExternalLongUnionExample.java b/conjure-java-core/src/integrationInput/java/com/palantir/product/ExternalLongUnionExample.java new file mode 100644 index 000000000..87118c9fd --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/com/palantir/product/ExternalLongUnionExample.java @@ -0,0 +1,354 @@ +package com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.palantir.logsafe.Preconditions; +import com.palantir.logsafe.Safe; +import com.palantir.logsafe.SafeArg; +import com.palantir.logsafe.exceptions.SafeIllegalArgumentException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.function.Function; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +/** + * A union of a safe and unsafe external long. + */ +@Generated("com.palantir.conjure.java.types.UnionGenerator") +public final class ExternalLongUnionExample { + private final Base value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private ExternalLongUnionExample(Base value) { + this.value = value; + } + + @JsonValue + private Base getValue() { + return value; + } + + public static ExternalLongUnionExample safeLong(long value) { + return new ExternalLongUnionExample(new SafeLongWrapper(value)); + } + + public static ExternalLongUnionExample unsafeLong(long value) { + return new ExternalLongUnionExample(new UnsafeLongWrapper(value)); + } + + public static ExternalLongUnionExample unknown(@Safe String type, Object value) { + switch (Preconditions.checkNotNull(type, "Type is required")) { + case "safeLong": + throw new SafeIllegalArgumentException( + "Unknown type cannot be created as the provided type is known: safeLong"); + case "unsafeLong": + throw new SafeIllegalArgumentException( + "Unknown type cannot be created as the provided type is known: unsafeLong"); + default: + return new ExternalLongUnionExample(new UnknownWrapper(type, Collections.singletonMap(type, value))); + } + } + + public T accept(Visitor visitor) { + return value.accept(visitor); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof ExternalLongUnionExample && equalTo((ExternalLongUnionExample) other)); + } + + private boolean equalTo(ExternalLongUnionExample other) { + return this.value.equals(other.value); + } + + @Override + public int hashCode() { + return this.value.hashCode(); + } + + @Override + public String toString() { + return "ExternalLongUnionExample{value: " + value + '}'; + } + + public interface Visitor { + T visitSafeLong(long value); + + T visitUnsafeLong(long value); + + T visitUnknown(@Safe String unknownType, Object unknownValue); + + static SafeLongStageVisitorBuilder builder() { + return new VisitorBuilder(); + } + } + + private static final class VisitorBuilder + implements SafeLongStageVisitorBuilder, + UnsafeLongStageVisitorBuilder, + UnknownStageVisitorBuilder, + Completed_StageVisitorBuilder { + private Function safeLongVisitor; + + private Function unsafeLongVisitor; + + private BiFunction<@Safe String, Object, T> unknownVisitor; + + @Override + public UnsafeLongStageVisitorBuilder safeLong(@Nonnull Function safeLongVisitor) { + Preconditions.checkNotNull(safeLongVisitor, "safeLongVisitor cannot be null"); + this.safeLongVisitor = safeLongVisitor; + return this; + } + + @Override + public UnknownStageVisitorBuilder unsafeLong(@Nonnull Function unsafeLongVisitor) { + Preconditions.checkNotNull(unsafeLongVisitor, "unsafeLongVisitor cannot be null"); + this.unsafeLongVisitor = unsafeLongVisitor; + return this; + } + + @Override + public Completed_StageVisitorBuilder unknown(@Nonnull BiFunction<@Safe String, Object, T> unknownVisitor) { + Preconditions.checkNotNull(unknownVisitor, "unknownVisitor cannot be null"); + this.unknownVisitor = unknownVisitor; + return this; + } + + @Override + public Completed_StageVisitorBuilder unknown(@Nonnull Function<@Safe String, T> unknownVisitor) { + Preconditions.checkNotNull(unknownVisitor, "unknownVisitor cannot be null"); + this.unknownVisitor = (unknownType, _unknownValue) -> unknownVisitor.apply(unknownType); + return this; + } + + @Override + public Completed_StageVisitorBuilder throwOnUnknown() { + this.unknownVisitor = (unknownType, _unknownValue) -> { + throw new SafeIllegalArgumentException( + "Unknown variant of the 'ExternalLongUnionExample' union", + SafeArg.of("unknownType", unknownType)); + }; + return this; + } + + @Override + public Visitor build() { + final Function safeLongVisitor = this.safeLongVisitor; + final Function unsafeLongVisitor = this.unsafeLongVisitor; + final BiFunction<@Safe String, Object, T> unknownVisitor = this.unknownVisitor; + return new Visitor() { + @Override + public T visitSafeLong(long value) { + return safeLongVisitor.apply(value); + } + + @Override + public T visitUnsafeLong(long value) { + return unsafeLongVisitor.apply(value); + } + + @Override + public T visitUnknown(String unknownType, Object unknownValue) { + return unknownVisitor.apply(unknownType, unknownValue); + } + }; + } + } + + public interface SafeLongStageVisitorBuilder { + UnsafeLongStageVisitorBuilder safeLong(@Nonnull Function safeLongVisitor); + } + + public interface UnsafeLongStageVisitorBuilder { + UnknownStageVisitorBuilder unsafeLong(@Nonnull Function unsafeLongVisitor); + } + + public interface UnknownStageVisitorBuilder { + Completed_StageVisitorBuilder unknown(@Nonnull BiFunction<@Safe String, Object, T> unknownVisitor); + + Completed_StageVisitorBuilder unknown(@Nonnull Function<@Safe String, T> unknownVisitor); + + Completed_StageVisitorBuilder throwOnUnknown(); + } + + public interface Completed_StageVisitorBuilder { + Visitor build(); + } + + @JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type", + visible = true, + defaultImpl = UnknownWrapper.class) + @JsonSubTypes({@JsonSubTypes.Type(SafeLongWrapper.class), @JsonSubTypes.Type(UnsafeLongWrapper.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Base { + T accept(Visitor visitor); + } + + @JsonTypeName("safeLong") + private static final class SafeLongWrapper implements Base { + private final long value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private SafeLongWrapper(@JsonSetter("safeLong") @Nonnull long value) { + Preconditions.checkNotNull(value, "safeLong cannot be null"); + this.value = value; + } + + @JsonProperty(value = "type", index = 0) + private String getType() { + return "safeLong"; + } + + @JsonProperty("safeLong") + private long getValue() { + return value; + } + + @Override + public T accept(Visitor visitor) { + return visitor.visitSafeLong(value); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof SafeLongWrapper && equalTo((SafeLongWrapper) other)); + } + + private boolean equalTo(SafeLongWrapper other) { + return this.value == other.value; + } + + @Override + public int hashCode() { + return Long.hashCode(this.value); + } + + @Override + public String toString() { + return "SafeLongWrapper{value: " + value + '}'; + } + } + + @JsonTypeName("unsafeLong") + private static final class UnsafeLongWrapper implements Base { + private final long value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UnsafeLongWrapper(@JsonSetter("unsafeLong") @Nonnull long value) { + Preconditions.checkNotNull(value, "unsafeLong cannot be null"); + this.value = value; + } + + @JsonProperty(value = "type", index = 0) + private String getType() { + return "unsafeLong"; + } + + @JsonProperty("unsafeLong") + private long getValue() { + return value; + } + + @Override + public T accept(Visitor visitor) { + return visitor.visitUnsafeLong(value); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof UnsafeLongWrapper && equalTo((UnsafeLongWrapper) other)); + } + + private boolean equalTo(UnsafeLongWrapper other) { + return this.value == other.value; + } + + @Override + public int hashCode() { + return Long.hashCode(this.value); + } + + @Override + public String toString() { + return "UnsafeLongWrapper{value: " + value + '}'; + } + } + + private static final class UnknownWrapper implements Base { + private final String type; + + private final Map value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UnknownWrapper(@JsonProperty("type") String type) { + this(type, new HashMap()); + } + + private UnknownWrapper(@Nonnull String type, @Nonnull Map value) { + Preconditions.checkNotNull(type, "type cannot be null"); + Preconditions.checkNotNull(value, "value cannot be null"); + this.type = type; + this.value = value; + } + + @JsonProperty + private String getType() { + return type; + } + + @JsonAnyGetter + private Map getValue() { + return value; + } + + @JsonAnySetter + private void put(String key, Object val) { + value.put(key, val); + } + + @Override + public T accept(Visitor visitor) { + return visitor.visitUnknown(type, value.get(type)); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof UnknownWrapper && equalTo((UnknownWrapper) other)); + } + + private boolean equalTo(UnknownWrapper other) { + return this.type.equals(other.type) && this.value.equals(other.value); + } + + @Override + public int hashCode() { + int hash = 1; + hash = 31 * hash + this.type.hashCode(); + hash = 31 * hash + this.value.hashCode(); + return hash; + } + + @Override + public String toString() { + return "UnknownWrapper{type: " + type + ", value: " + value + '}'; + } + } +} diff --git a/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalAliasExample.java b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalAliasExample.java new file mode 100644 index 000000000..6f434d818 --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalAliasExample.java @@ -0,0 +1,50 @@ +package com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.palantir.logsafe.Preconditions; +import com.palantir.logsafe.Safe; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +@Safe +@Generated("com.palantir.conjure.java.types.AliasGenerator") +public final class SafeExternalAliasExample { + private final SafeExternalLongAlias value; + + private SafeExternalAliasExample(@Nonnull SafeExternalLongAlias value) { + this.value = Preconditions.checkNotNull(value, "value cannot be null"); + } + + @JsonValue + public SafeExternalLongAlias get() { + return value; + } + + @Override + public String toString() { + return value.toString(); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other + || (other instanceof SafeExternalAliasExample + && this.value.equals(((SafeExternalAliasExample) other).value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + public static SafeExternalAliasExample valueOf(String value) { + return of(SafeExternalLongAlias.valueOf(value)); + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SafeExternalAliasExample of(@Nonnull SafeExternalLongAlias value) { + return new SafeExternalAliasExample(value); + } +} diff --git a/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongAlias.java b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongAlias.java new file mode 100644 index 000000000..a767a7aa6 --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongAlias.java @@ -0,0 +1,48 @@ +package com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.palantir.logsafe.Safe; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +@Safe +@Generated("com.palantir.conjure.java.types.AliasGenerator") +public final class SafeExternalLongAlias { + private final long value; + + private SafeExternalLongAlias(long value) { + this.value = value; + } + + @JsonValue + public long get() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other + || (other instanceof SafeExternalLongAlias && this.value == ((SafeExternalLongAlias) other).value); + } + + @Override + public int hashCode() { + return Long.hashCode(value); + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SafeExternalLongAlias valueOf(String value) { + return of(Long.valueOf(value)); + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SafeExternalLongAlias of(long value) { + return new SafeExternalLongAlias(value); + } +} diff --git a/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongExample.java b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongExample.java new file mode 100644 index 000000000..ffc9e06ec --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongExample.java @@ -0,0 +1,114 @@ +package com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.palantir.logsafe.Preconditions; +import com.palantir.logsafe.Safe; +import com.palantir.logsafe.SafeArg; +import com.palantir.logsafe.exceptions.SafeIllegalArgumentException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +@Safe +@JsonDeserialize(builder = SafeExternalLongExample.Builder.class) +@Generated("com.palantir.conjure.java.types.BeanGenerator") +public final class SafeExternalLongExample { + private final long safeExternalLongValue; + + private SafeExternalLongExample(long safeExternalLongValue) { + this.safeExternalLongValue = safeExternalLongValue; + } + + @JsonProperty("safeExternalLongValue") + public long getSafeExternalLongValue() { + return this.safeExternalLongValue; + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof SafeExternalLongExample && equalTo((SafeExternalLongExample) other)); + } + + private boolean equalTo(SafeExternalLongExample other) { + return this.safeExternalLongValue == other.safeExternalLongValue; + } + + @Override + public int hashCode() { + return Long.hashCode(this.safeExternalLongValue); + } + + @Override + @Safe + public String toString() { + return "SafeExternalLongExample{safeExternalLongValue: " + safeExternalLongValue + '}'; + } + + public static SafeExternalLongExample of(long safeExternalLongValue) { + return builder().safeExternalLongValue(safeExternalLongValue).build(); + } + + public static Builder builder() { + return new Builder(); + } + + @Generated("com.palantir.conjure.java.types.BeanBuilderGenerator") + public static final class Builder { + boolean _buildInvoked; + + private long safeExternalLongValue; + + private boolean _safeExternalLongValueInitialized = false; + + private Builder() {} + + public Builder from(SafeExternalLongExample other) { + checkNotBuilt(); + safeExternalLongValue(other.getSafeExternalLongValue()); + return this; + } + + @JsonSetter("safeExternalLongValue") + public Builder safeExternalLongValue(long safeExternalLongValue) { + checkNotBuilt(); + this.safeExternalLongValue = safeExternalLongValue; + this._safeExternalLongValueInitialized = true; + return this; + } + + private void validatePrimitiveFieldsHaveBeenInitialized() { + List missingFields = null; + missingFields = + addFieldIfMissing(missingFields, _safeExternalLongValueInitialized, "safeExternalLongValue"); + if (missingFields != null) { + throw new SafeIllegalArgumentException( + "Some required fields have not been set", SafeArg.of("missingFields", missingFields)); + } + } + + private static List addFieldIfMissing(List prev, boolean initialized, String fieldName) { + List missingFields = prev; + if (!initialized) { + if (missingFields == null) { + missingFields = new ArrayList<>(1); + } + missingFields.add(fieldName); + } + return missingFields; + } + + public SafeExternalLongExample build() { + checkNotBuilt(); + this._buildInvoked = true; + validatePrimitiveFieldsHaveBeenInitialized(); + return new SafeExternalLongExample(safeExternalLongValue); + } + + private void checkNotBuilt() { + Preconditions.checkState(!_buildInvoked, "Build has already been called"); + } + } +} diff --git a/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/ExternalLongUnionExample.java b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/ExternalLongUnionExample.java new file mode 100644 index 000000000..d2f680a71 --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/ExternalLongUnionExample.java @@ -0,0 +1,344 @@ +package test.prefix.com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.palantir.logsafe.Preconditions; +import com.palantir.logsafe.Safe; +import com.palantir.logsafe.SafeArg; +import com.palantir.logsafe.exceptions.SafeIllegalArgumentException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Function; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +/** + * A union of a safe and unsafe external long. + */ +@Generated("com.palantir.conjure.java.types.UnionGenerator") +public final class ExternalLongUnionExample { + private final Base value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private ExternalLongUnionExample(Base value) { + this.value = value; + } + + @JsonValue + private Base getValue() { + return value; + } + + public static ExternalLongUnionExample safeLong(long value) { + return new ExternalLongUnionExample(new SafeLongWrapper(value)); + } + + public static ExternalLongUnionExample unsafeLong(long value) { + return new ExternalLongUnionExample(new UnsafeLongWrapper(value)); + } + + public static ExternalLongUnionExample unknown(@Safe String type, Object value) { + switch (Preconditions.checkNotNull(type, "Type is required")) { + case "safeLong": + throw new SafeIllegalArgumentException( + "Unknown type cannot be created as the provided type is known: safeLong"); + case "unsafeLong": + throw new SafeIllegalArgumentException( + "Unknown type cannot be created as the provided type is known: unsafeLong"); + default: + return new ExternalLongUnionExample(new UnknownWrapper(type, Collections.singletonMap(type, value))); + } + } + + public T accept(Visitor visitor) { + return value.accept(visitor); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof ExternalLongUnionExample && equalTo((ExternalLongUnionExample) other)); + } + + private boolean equalTo(ExternalLongUnionExample other) { + return this.value.equals(other.value); + } + + @Override + public int hashCode() { + return this.value.hashCode(); + } + + @Override + public String toString() { + return "ExternalLongUnionExample{value: " + value + '}'; + } + + public interface Visitor { + T visitSafeLong(long value); + + T visitUnsafeLong(long value); + + T visitUnknown(@Safe String unknownType); + + static SafeLongStageVisitorBuilder builder() { + return new VisitorBuilder(); + } + } + + private static final class VisitorBuilder + implements SafeLongStageVisitorBuilder, + UnsafeLongStageVisitorBuilder, + UnknownStageVisitorBuilder, + Completed_StageVisitorBuilder { + private Function safeLongVisitor; + + private Function unsafeLongVisitor; + + private Function unknownVisitor; + + @Override + public UnsafeLongStageVisitorBuilder safeLong(@Nonnull Function safeLongVisitor) { + Preconditions.checkNotNull(safeLongVisitor, "safeLongVisitor cannot be null"); + this.safeLongVisitor = safeLongVisitor; + return this; + } + + @Override + public UnknownStageVisitorBuilder unsafeLong(@Nonnull Function unsafeLongVisitor) { + Preconditions.checkNotNull(unsafeLongVisitor, "unsafeLongVisitor cannot be null"); + this.unsafeLongVisitor = unsafeLongVisitor; + return this; + } + + @Override + public Completed_StageVisitorBuilder unknown(@Nonnull Function unknownVisitor) { + Preconditions.checkNotNull(unknownVisitor, "unknownVisitor cannot be null"); + this.unknownVisitor = unknownVisitor; + return this; + } + + @Override + public Completed_StageVisitorBuilder throwOnUnknown() { + this.unknownVisitor = unknownType -> { + throw new SafeIllegalArgumentException( + "Unknown variant of the 'ExternalLongUnionExample' union", + SafeArg.of("unknownType", unknownType)); + }; + return this; + } + + @Override + public Visitor build() { + final Function safeLongVisitor = this.safeLongVisitor; + final Function unsafeLongVisitor = this.unsafeLongVisitor; + final Function unknownVisitor = this.unknownVisitor; + return new Visitor() { + @Override + public T visitSafeLong(long value) { + return safeLongVisitor.apply(value); + } + + @Override + public T visitUnsafeLong(long value) { + return unsafeLongVisitor.apply(value); + } + + @Override + public T visitUnknown(String value) { + return unknownVisitor.apply(value); + } + }; + } + } + + public interface SafeLongStageVisitorBuilder { + UnsafeLongStageVisitorBuilder safeLong(@Nonnull Function safeLongVisitor); + } + + public interface UnsafeLongStageVisitorBuilder { + UnknownStageVisitorBuilder unsafeLong(@Nonnull Function unsafeLongVisitor); + } + + public interface UnknownStageVisitorBuilder { + Completed_StageVisitorBuilder unknown(@Nonnull Function unknownVisitor); + + Completed_StageVisitorBuilder throwOnUnknown(); + } + + public interface Completed_StageVisitorBuilder { + Visitor build(); + } + + @JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.EXISTING_PROPERTY, + property = "type", + visible = true, + defaultImpl = UnknownWrapper.class) + @JsonSubTypes({@JsonSubTypes.Type(SafeLongWrapper.class), @JsonSubTypes.Type(UnsafeLongWrapper.class)}) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Base { + T accept(Visitor visitor); + } + + @JsonTypeName("safeLong") + private static final class SafeLongWrapper implements Base { + private final long value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private SafeLongWrapper(@JsonSetter("safeLong") @Nonnull long value) { + Preconditions.checkNotNull(value, "safeLong cannot be null"); + this.value = value; + } + + @JsonProperty(value = "type", index = 0) + private String getType() { + return "safeLong"; + } + + @JsonProperty("safeLong") + private long getValue() { + return value; + } + + @Override + public T accept(Visitor visitor) { + return visitor.visitSafeLong(value); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof SafeLongWrapper && equalTo((SafeLongWrapper) other)); + } + + private boolean equalTo(SafeLongWrapper other) { + return this.value == other.value; + } + + @Override + public int hashCode() { + return Long.hashCode(this.value); + } + + @Override + public String toString() { + return "SafeLongWrapper{value: " + value + '}'; + } + } + + @JsonTypeName("unsafeLong") + private static final class UnsafeLongWrapper implements Base { + private final long value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UnsafeLongWrapper(@JsonSetter("unsafeLong") @Nonnull long value) { + Preconditions.checkNotNull(value, "unsafeLong cannot be null"); + this.value = value; + } + + @JsonProperty(value = "type", index = 0) + private String getType() { + return "unsafeLong"; + } + + @JsonProperty("unsafeLong") + private long getValue() { + return value; + } + + @Override + public T accept(Visitor visitor) { + return visitor.visitUnsafeLong(value); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof UnsafeLongWrapper && equalTo((UnsafeLongWrapper) other)); + } + + private boolean equalTo(UnsafeLongWrapper other) { + return this.value == other.value; + } + + @Override + public int hashCode() { + return Long.hashCode(this.value); + } + + @Override + public String toString() { + return "UnsafeLongWrapper{value: " + value + '}'; + } + } + + private static final class UnknownWrapper implements Base { + private final String type; + + private final Map value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UnknownWrapper(@JsonProperty("type") String type) { + this(type, new HashMap()); + } + + private UnknownWrapper(@Nonnull String type, @Nonnull Map value) { + Preconditions.checkNotNull(type, "type cannot be null"); + Preconditions.checkNotNull(value, "value cannot be null"); + this.type = type; + this.value = value; + } + + @JsonProperty + private String getType() { + return type; + } + + @JsonAnyGetter + private Map getValue() { + return value; + } + + @JsonAnySetter + private void put(String key, Object val) { + value.put(key, val); + } + + @Override + public T accept(Visitor visitor) { + return visitor.visitUnknown(type); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof UnknownWrapper && equalTo((UnknownWrapper) other)); + } + + private boolean equalTo(UnknownWrapper other) { + return this.type.equals(other.type) && this.value.equals(other.value); + } + + @Override + public int hashCode() { + int hash = 1; + hash = 31 * hash + this.type.hashCode(); + hash = 31 * hash + this.value.hashCode(); + return hash; + } + + @Override + public String toString() { + return "UnknownWrapper{type: " + type + ", value: " + value + '}'; + } + } +} diff --git a/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalAliasExample.java b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalAliasExample.java new file mode 100644 index 000000000..136c56441 --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalAliasExample.java @@ -0,0 +1,50 @@ +package test.prefix.com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.palantir.logsafe.Preconditions; +import com.palantir.logsafe.Safe; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +@Safe +@Generated("com.palantir.conjure.java.types.AliasGenerator") +public final class SafeExternalAliasExample { + private final SafeExternalLongAlias value; + + private SafeExternalAliasExample(@Nonnull SafeExternalLongAlias value) { + this.value = Preconditions.checkNotNull(value, "value cannot be null"); + } + + @JsonValue + public SafeExternalLongAlias get() { + return value; + } + + @Override + public String toString() { + return value.toString(); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other + || (other instanceof SafeExternalAliasExample + && this.value.equals(((SafeExternalAliasExample) other).value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } + + public static SafeExternalAliasExample valueOf(String value) { + return of(SafeExternalLongAlias.valueOf(value)); + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SafeExternalAliasExample of(@Nonnull SafeExternalLongAlias value) { + return new SafeExternalAliasExample(value); + } +} diff --git a/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongAlias.java b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongAlias.java new file mode 100644 index 000000000..a73971934 --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongAlias.java @@ -0,0 +1,48 @@ +package test.prefix.com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.palantir.logsafe.Safe; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +@Safe +@Generated("com.palantir.conjure.java.types.AliasGenerator") +public final class SafeExternalLongAlias { + private final long value; + + private SafeExternalLongAlias(long value) { + this.value = value; + } + + @JsonValue + public long get() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other + || (other instanceof SafeExternalLongAlias && this.value == ((SafeExternalLongAlias) other).value); + } + + @Override + public int hashCode() { + return Long.hashCode(value); + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SafeExternalLongAlias valueOf(String value) { + return of(Long.valueOf(value)); + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SafeExternalLongAlias of(long value) { + return new SafeExternalLongAlias(value); + } +} diff --git a/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongExample.java b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongExample.java new file mode 100644 index 000000000..eb8dc0fac --- /dev/null +++ b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongExample.java @@ -0,0 +1,116 @@ +package test.prefix.com.palantir.product; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.palantir.logsafe.Preconditions; +import com.palantir.logsafe.Safe; +import com.palantir.logsafe.SafeArg; +import com.palantir.logsafe.exceptions.SafeIllegalArgumentException; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; +import javax.annotation.processing.Generated; + +@Safe +@JsonDeserialize(builder = SafeExternalLongExample.Builder.class) +@Generated("com.palantir.conjure.java.types.BeanGenerator") +public final class SafeExternalLongExample { + private final long safeExternalLongValue; + + private SafeExternalLongExample(long safeExternalLongValue) { + this.safeExternalLongValue = safeExternalLongValue; + } + + @JsonProperty("safeExternalLongValue") + public long getSafeExternalLongValue() { + return this.safeExternalLongValue; + } + + @Override + public boolean equals(@Nullable Object other) { + return this == other || (other instanceof SafeExternalLongExample && equalTo((SafeExternalLongExample) other)); + } + + private boolean equalTo(SafeExternalLongExample other) { + return this.safeExternalLongValue == other.safeExternalLongValue; + } + + @Override + public int hashCode() { + return Long.hashCode(this.safeExternalLongValue); + } + + @Override + @Safe + public String toString() { + return "SafeExternalLongExample{safeExternalLongValue: " + safeExternalLongValue + '}'; + } + + public static SafeExternalLongExample of(long safeExternalLongValue) { + return builder().safeExternalLongValue(safeExternalLongValue).build(); + } + + public static Builder builder() { + return new Builder(); + } + + @Generated("com.palantir.conjure.java.types.BeanBuilderGenerator") + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + boolean _buildInvoked; + + private long safeExternalLongValue; + + private boolean _safeExternalLongValueInitialized = false; + + private Builder() {} + + public Builder from(SafeExternalLongExample other) { + checkNotBuilt(); + safeExternalLongValue(other.getSafeExternalLongValue()); + return this; + } + + @JsonSetter("safeExternalLongValue") + public Builder safeExternalLongValue(long safeExternalLongValue) { + checkNotBuilt(); + this.safeExternalLongValue = safeExternalLongValue; + this._safeExternalLongValueInitialized = true; + return this; + } + + private void validatePrimitiveFieldsHaveBeenInitialized() { + List missingFields = null; + missingFields = + addFieldIfMissing(missingFields, _safeExternalLongValueInitialized, "safeExternalLongValue"); + if (missingFields != null) { + throw new SafeIllegalArgumentException( + "Some required fields have not been set", SafeArg.of("missingFields", missingFields)); + } + } + + private static List addFieldIfMissing(List prev, boolean initialized, String fieldName) { + List missingFields = prev; + if (!initialized) { + if (missingFields == null) { + missingFields = new ArrayList<>(1); + } + missingFields.add(fieldName); + } + return missingFields; + } + + public SafeExternalLongExample build() { + checkNotBuilt(); + this._buildInvoked = true; + validatePrimitiveFieldsHaveBeenInitialized(); + return new SafeExternalLongExample(safeExternalLongValue); + } + + private void checkNotBuilt() { + Preconditions.checkState(!_buildInvoked, "Build has already been called"); + } + } +} diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/SafetyEvaluator.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/SafetyEvaluator.java index 3e3dfa9fa..0db1b9eeb 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/SafetyEvaluator.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/SafetyEvaluator.java @@ -187,9 +187,8 @@ public Optional visitReference(TypeName value) { } @Override - public Optional visitExternal(ExternalReference _value) { - // External types have unknown safety for now - return Optional.empty(); + public Optional visitExternal(ExternalReference value) { + return value.getSafety(); } @Override diff --git a/conjure-java-core/src/test/java/com/palantir/conjure/java/types/SafetyEvaluatorTest.java b/conjure-java-core/src/test/java/com/palantir/conjure/java/types/SafetyEvaluatorTest.java index 9f77efeef..5900dde0f 100644 --- a/conjure-java-core/src/test/java/com/palantir/conjure/java/types/SafetyEvaluatorTest.java +++ b/conjure-java-core/src/test/java/com/palantir/conjure/java/types/SafetyEvaluatorTest.java @@ -19,11 +19,13 @@ import static org.assertj.core.api.Assertions.assertThat; import com.google.common.collect.Iterables; +import com.palantir.conjure.defs.SafetyDeclarationRequirements; import com.palantir.conjure.defs.validator.ConjureDefinitionValidator; import com.palantir.conjure.spec.AliasDefinition; import com.palantir.conjure.spec.ConjureDefinition; import com.palantir.conjure.spec.Documentation; import com.palantir.conjure.spec.EnumDefinition; +import com.palantir.conjure.spec.ExternalReference; import com.palantir.conjure.spec.FieldDefinition; import com.palantir.conjure.spec.FieldName; import com.palantir.conjure.spec.LogSafety; @@ -35,7 +37,12 @@ import com.palantir.conjure.spec.TypeName; import com.palantir.conjure.spec.UnionDefinition; import java.util.Optional; +import java.util.stream.Stream; +import org.junit.jupiter.api.Named; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; class SafetyEvaluatorTest { private static final String PACKAGE = "package"; @@ -130,11 +137,44 @@ void testMapSafeKey() { .types(object) .types(SAFE_ALIAS) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(object)).isEmpty(); } + private static Stream providesExternalRefTypes_WithSafety() { + Type external = Type.external(ExternalReference.builder() + .externalReference(TypeName.of("Long", "java.lang")) + .fallback(Type.primitive(PrimitiveType.STRING)) + .safety(LogSafety.DO_NOT_LOG) + .build()); + return getTypes(external); + } + + @ParameterizedTest + @MethodSource("providesExternalRefTypes_WithSafety") + void testExternalRefType_WithSafety(TypeDefinition typeDefinition, ConjureDefinition conjureDef) { + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); + SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); + assertThat(evaluator.evaluate(typeDefinition)).hasValue(LogSafety.DO_NOT_LOG); + } + + private static Stream providesExternalRefTypes_NoSafety() { + Type external = Type.external(ExternalReference.builder() + .externalReference(TypeName.of("Long", "java.lang")) + .fallback(Type.primitive(PrimitiveType.STRING)) + .build()); + return getTypes(external); + } + + @ParameterizedTest + @MethodSource("providesExternalRefTypes_NoSafety") + void testExternalRefType_NoSafety(TypeDefinition typeDefinition, ConjureDefinition conjureDef) { + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); + SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); + assertThat(evaluator.evaluate(typeDefinition)).isEmpty(); + } + @Test void testMapSafetyUnsafeValue() { TypeDefinition object = TypeDefinition.object(ObjectDefinition.builder() @@ -150,7 +190,7 @@ void testMapSafetyUnsafeValue() { .types(SAFE_ALIAS) .types(UNSAFE_ALIAS) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(object)).hasValue(LogSafety.UNSAFE); } @@ -170,7 +210,7 @@ void testMapSafetySafeKeyAndValue() { .types(SAFE_ALIAS) .types(UNSAFE_ALIAS) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(object)).hasValue(LogSafety.SAFE); } @@ -203,7 +243,7 @@ void testNested() { .types(secondObject) .types(UNSAFE_ALIAS) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(firstObject)).hasValue(LogSafety.UNSAFE); } @@ -222,7 +262,7 @@ void testPrimitiveSafety() { .build()) .build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .hasValue(LogSafety.UNSAFE); @@ -241,7 +281,7 @@ void testNoSafety() { .build()) .build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .isEmpty(); @@ -254,7 +294,7 @@ void testEmptyUnion() { .types(TypeDefinition.union( UnionDefinition.builder().typeName(FOO).build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .as("No guarantees can be made about future union values, " @@ -275,7 +315,7 @@ void testUnsafeElementUnion() { .build()) .build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .hasValue(LogSafety.UNSAFE); @@ -294,7 +334,7 @@ void testDoNotLogElementUnion() { .build()) .build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .hasValue(LogSafety.DO_NOT_LOG); @@ -307,7 +347,7 @@ void testEmptyObject() { .types(TypeDefinition.object( ObjectDefinition.builder().typeName(FOO).build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .hasValue(LogSafety.SAFE); @@ -320,9 +360,52 @@ void testEmptyEnum() { .types(TypeDefinition.enum_( EnumDefinition.builder().typeName(FOO).build())) .build(); - ConjureDefinitionValidator.validateAll(conjureDef); + ConjureDefinitionValidator.validateAll(conjureDef, SafetyDeclarationRequirements.ALLOWED); SafetyEvaluator evaluator = new SafetyEvaluator(conjureDef); assertThat(evaluator.evaluate(Iterables.getOnlyElement(conjureDef.getTypes()))) .hasValue(LogSafety.SAFE); } + + private static Stream getTypes(Type externalReference) { + TypeDefinition objectType = TypeDefinition.object(ObjectDefinition.builder() + .typeName(FOO) + .fields(FieldDefinition.builder() + .fieldName(FieldName.of("import")) + .type(externalReference) + .docs(DOCS) + .build()) + .build()); + ConjureDefinition conjureObjectDef = ConjureDefinition.builder() + .version(1) + .types(objectType) + .types(UNSAFE_ALIAS) + .build(); + + TypeDefinition aliasType = TypeDefinition.alias( + AliasDefinition.builder().typeName(FOO).alias(externalReference).build()); + ConjureDefinition conjureAliasDef = ConjureDefinition.builder() + .version(1) + .types(aliasType) + .types(UNSAFE_ALIAS) + .build(); + + TypeDefinition unionType = TypeDefinition.union(UnionDefinition.builder() + .union(FieldDefinition.builder() + .fieldName(FieldName.of("importOne")) + .type(externalReference) + .docs(DOCS) + .build()) + .typeName(FOO) + .build()); + ConjureDefinition conjureUnionDef = ConjureDefinition.builder() + .version(1) + .types(unionType) + .types(UNSAFE_ALIAS) + .build(); + + return Stream.of( + Arguments.of(Named.of("Object", objectType), conjureObjectDef), + Arguments.of(Named.of("Alias", aliasType), conjureAliasDef), + Arguments.of(Named.of("Union", unionType), conjureUnionDef)); + } } diff --git a/conjure-java-core/src/test/resources/example-types.yml b/conjure-java-core/src/test/resources/example-types.yml index 9fd88b30f..4caf65cb7 100644 --- a/conjure-java-core/src/test/resources/example-types.yml +++ b/conjure-java-core/src/test/resources/example-types.yml @@ -13,6 +13,11 @@ types: base-type: string external: java: java.lang.String + SafeExternalLong: + base-type: safelong + external: + java: java.lang.Long + safety: safe definitions: default-package: com.palantir.product objects: @@ -25,6 +30,9 @@ types: SafeLongExample: fields: safeLongValue: safelong + SafeExternalLongExample: + fields: + safeExternalLongValue: SafeExternalLong RidExample: fields: ridValue: rid @@ -131,6 +139,8 @@ types: alias: datetime BinaryAliasExample: alias: binary + SafeExternalAliasExample: + alias: SafeExternalLongAlias PrimitiveOptionalsExample: fields: num: optional @@ -214,6 +224,11 @@ types: unknown: string EmptyUnionTypeExample: union: {} + ExternalLongUnionExample: + docs: A union of a safe and unsafe external long. + union: + safeLong: SafeExternalLong + unsafeLong: ExternalLong EmptyObjectExample: fields: {} AliasAsMapKeyExample: @@ -272,6 +287,8 @@ types: alias: ExternalLong ExternalLongAliasTwo: alias: ExternalLongAliasOne + SafeExternalLongAlias: + alias: SafeExternalLong OptionalAlias: alias: optional safety: safe @@ -284,4 +301,4 @@ types: var: string class: string int: string - len: string + len: string \ No newline at end of file diff --git a/versions.lock b/versions.lock index c0979ff8d..2c4a1b35c 100644 --- a/versions.lock +++ b/versions.lock @@ -2,12 +2,12 @@ com.atlassian.commonmark:commonmark:0.12.1 (1 constraints: 36052a3b) com.fasterxml.jackson.core:jackson-annotations:2.14.1 (20 constraints: c14d5f30) com.fasterxml.jackson.core:jackson-core:2.14.1 (18 constraints: 386dff6a) -com.fasterxml.jackson.core:jackson-databind:2.14.1 (35 constraints: a7918e71) +com.fasterxml.jackson.core:jackson-databind:2.14.1 (35 constraints: e99011cd) com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.14.1 (2 constraints: e1338f00) com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.14.1 (1 constraints: 7f1c9ca4) -com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.1 (3 constraints: 3b25d80f) +com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.1 (3 constraints: 3b25da0f) com.fasterxml.jackson.datatype:jackson-datatype-guava:2.14.1 (4 constraints: a65067ce) -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1 (4 constraints: 2a3f0b90) +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1 (4 constraints: 2a3f0d90) com.fasterxml.jackson.datatype:jackson-datatype-joda:2.14.1 (2 constraints: 302bedaf) com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1 (2 constraints: 302bedaf) com.fasterxml.jackson.module:jackson-module-afterburner:2.14.1 (2 constraints: 4c2b80b6) @@ -20,8 +20,8 @@ com.google.guava:guava:31.1-jre (34 constraints: 2b5e25c9) com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava (1 constraints: bd17c918) com.google.j2objc:j2objc-annotations:1.3 (1 constraints: b809eda0) com.palantir.common:streams:2.1.0 (1 constraints: 0505f835) -com.palantir.conjure:conjure-api-objects:4.28.0 (2 constraints: 6322d2e4) -com.palantir.conjure:conjure-generator-common:4.28.0 (2 constraints: 07149683) +com.palantir.conjure:conjure-api-objects:4.36.0 (2 constraints: 612297e4) +com.palantir.conjure:conjure-generator-common:4.36.0 (2 constraints: 05146783) com.palantir.conjure.java.api:errors:2.34.0 (6 constraints: d66d7bc6) com.palantir.conjure.java.api:service-config:2.34.0 (4 constraints: 3848f64e) com.palantir.conjure.java.api:ssl-config:2.34.0 (2 constraints: a825c238) @@ -46,7 +46,7 @@ com.palantir.safe-logging:logger-spi:3.2.0 (2 constraints: 0f1e997a) com.palantir.safe-logging:preconditions:3.2.0 (26 constraints: 93cdde31) com.palantir.safe-logging:safe-logging:3.2.0 (21 constraints: 0d5d6eb0) com.palantir.safethreadlocalrandom:safe-thread-local-random:0.1.0 (3 constraints: 933225f9) -com.palantir.syntactic-paths:syntactic-paths:0.9.0 (2 constraints: 9b137361) +com.palantir.syntactic-paths:syntactic-paths:0.9.0 (2 constraints: 9d137b61) com.palantir.tokens:auth-tokens:3.16.0 (5 constraints: 5e511ae3) com.palantir.tracing:tracing:6.15.0 (8 constraints: de7caf43) com.palantir.tracing:tracing-api:6.15.0 (6 constraints: 1760c248) @@ -78,7 +78,7 @@ org.jboss.logging:jboss-logging:3.4.1.Final (4 constraints: a24557a8) org.jboss.threads:jboss-threads:3.1.0.Final (2 constraints: 561a9b42) org.jboss.xnio:xnio-api:3.8.7.Final (2 constraints: 771a3146) org.jboss.xnio:xnio-nio:3.8.7.Final (1 constraints: c80dcb30) -org.jetbrains:annotations:24.0.0 (3 constraints: 94287fbe) +org.jetbrains:annotations:24.0.0 (4 constraints: fa396f95) org.mpierce.metrics.reservoir:hdrhistogram-metrics-reservoir:1.1.3 (1 constraints: 0d10f991) org.slf4j:slf4j-api:1.7.36 (27 constraints: 608897a9) org.slf4j:slf4j-simple:1.7.36 (1 constraints: 43054b3b) @@ -105,7 +105,7 @@ com.helger:profiler:1.1.1 (1 constraints: e21053b8) com.netflix.concurrency-limits:concurrency-limits-core:0.2.2 (1 constraints: 7d14fe7b) com.netflix.feign:feign-core:8.18.0 (3 constraints: de3f76e0) com.netflix.feign:feign-jackson:8.18.0 (1 constraints: c718909e) -com.palantir.conjure:conjure-core:4.28.0 (1 constraints: 4005573b) +com.palantir.conjure:conjure-core:4.36.0 (1 constraints: 3f05553b) com.palantir.conjure.java.api:test-utils:2.34.0 (1 constraints: 3b05433b) com.palantir.conjure.java.runtime:conjure-java-annotations:7.39.0 (1 constraints: c918959e) com.palantir.conjure.java.runtime:conjure-java-jaxrs-client:7.39.0 (1 constraints: 4505703b) diff --git a/versions.props b/versions.props index e72009122..79f4dba53 100644 --- a/versions.props +++ b/versions.props @@ -7,7 +7,7 @@ com.palantir.common:streams = 2.1.0 com.palantir.conjure.java.api:* = 2.34.0 com.palantir.conjure.java.runtime:* = 7.39.0 com.palantir.conjure.verification:* = 0.19.0 -com.palantir.conjure:* = 4.28.0 +com.palantir.conjure:* = 4.36.0 com.palantir.dialogue:* = 3.74.0 com.palantir.ri:resource-identifier = 2.5.0 com.palantir.safe-logging:* = 3.2.0