From be327761fcd2c3723ccfd04c67b03c015fbf0d7c Mon Sep 17 00:00:00 2001 From: Lavanya Singh Date: Fri, 10 Feb 2023 16:27:28 -0500 Subject: [PATCH] collections and optionals work now --- .../palantir/product/NestedTypesExample.java | 4 +- .../product/SafeExternalLongExample.java | 4 +- .../palantir/product/NestedTypesExample.java | 222 ------------------ .../product/SafeExternalLongExample.java | 4 +- .../BeanBuilderAuxiliarySettersUtils.java | 29 ++- .../java/types/BeanBuilderGenerator.java | 18 +- .../java/types/ExternalImportSafetyTests.java | 29 ++- .../java/types/ObjectGeneratorTests.java | 40 ---- .../src/test/resources/example-types.yml | 11 - .../src/test/resources/example.yml | 17 -- 10 files changed, 58 insertions(+), 320 deletions(-) delete mode 100644 conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/NestedTypesExample.java delete mode 100644 conjure-java-core/src/test/resources/example.yml diff --git a/conjure-java-core/src/integrationInput/java/com/palantir/product/NestedTypesExample.java b/conjure-java-core/src/integrationInput/java/com/palantir/product/NestedTypesExample.java index d30e80824..e6a79994e 100644 --- a/conjure-java-core/src/integrationInput/java/com/palantir/product/NestedTypesExample.java +++ b/conjure-java-core/src/integrationInput/java/com/palantir/product/NestedTypesExample.java @@ -180,7 +180,7 @@ public Builder addAllStringList(@Safe @Nonnull Iterable stringList) { return this; } - public Builder stringList(String stringList) { + public Builder stringList(@Safe String stringList) { checkNotBuilt(); this.stringList.add(stringList); return this; @@ -201,7 +201,7 @@ public Builder addAllStringSet(@Safe @Nonnull Iterable stringSet) { return this; } - public Builder stringSet(String stringSet) { + public Builder stringSet(@Safe String stringSet) { checkNotBuilt(); this.stringSet.add(stringSet); return this; 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 index 3288f5ec7..dc77dfbf4 100644 --- a/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongExample.java +++ b/conjure-java-core/src/integrationInput/java/com/palantir/product/SafeExternalLongExample.java @@ -204,7 +204,7 @@ public Builder addAllSafeExternalLongList(@Safe @Nonnull Iterable return this; } - public Builder safeExternalLongSet(long safeExternalLongSet) { + public Builder safeExternalLongSet(@Safe long safeExternalLongSet) { checkNotBuilt(); this.safeExternalLongSet.add(safeExternalLongSet); return this; diff --git a/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/NestedTypesExample.java b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/NestedTypesExample.java deleted file mode 100644 index 26a2dec68..000000000 --- a/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/NestedTypesExample.java +++ /dev/null @@ -1,222 +0,0 @@ -package test.prefix.com.palantir.product; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.palantir.conjure.java.lib.internal.ConjureCollections; -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.Collections; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import javax.annotation.processing.Generated; - -@Safe -@JsonDeserialize(builder = NestedTypesExample.Builder.class) -@Generated("com.palantir.conjure.java.types.BeanGenerator") -public final class NestedTypesExample { - private final Optional optionalString; - - private final List stringList; - - private final Set stringSet; - - private int memoizedHashCode; - - private NestedTypesExample(Optional optionalString, List stringList, Set stringSet) { - validateFields(optionalString, stringList, stringSet); - this.optionalString = optionalString; - this.stringList = Collections.unmodifiableList(stringList); - this.stringSet = Collections.unmodifiableSet(stringSet); - } - - @JsonProperty("optionalString") - @Safe - @JsonInclude(JsonInclude.Include.NON_ABSENT) - public Optional getOptionalString() { - return this.optionalString; - } - - @JsonProperty("stringList") - @Safe - public List getStringList() { - return this.stringList; - } - - @JsonProperty("stringSet") - @Safe - public Set getStringSet() { - return this.stringSet; - } - - @Override - public boolean equals(@Nullable Object other) { - return this == other || (other instanceof NestedTypesExample && equalTo((NestedTypesExample) other)); - } - - private boolean equalTo(NestedTypesExample other) { - if (this.memoizedHashCode != 0 - && other.memoizedHashCode != 0 - && this.memoizedHashCode != other.memoizedHashCode) { - return false; - } - return this.optionalString.equals(other.optionalString) - && this.stringList.equals(other.stringList) - && this.stringSet.equals(other.stringSet); - } - - @Override - public int hashCode() { - int result = memoizedHashCode; - if (result == 0) { - int hash = 1; - hash = 31 * hash + this.optionalString.hashCode(); - hash = 31 * hash + this.stringList.hashCode(); - hash = 31 * hash + this.stringSet.hashCode(); - result = hash; - memoizedHashCode = result; - } - return result; - } - - @Override - @Safe - public String toString() { - return "NestedTypesExample{optionalString: " + optionalString + ", stringList: " + stringList + ", stringSet: " - + stringSet + '}'; - } - - public static NestedTypesExample of( - @Safe String optionalString, @Safe List stringList, @Safe Set stringSet) { - return builder() - .optionalString(Optional.of(optionalString)) - .stringList(stringList) - .stringSet(stringSet) - .build(); - } - - private static void validateFields( - Optional optionalString, List stringList, Set stringSet) { - List missingFields = null; - missingFields = addFieldIfMissing(missingFields, optionalString, "optionalString"); - missingFields = addFieldIfMissing(missingFields, stringList, "stringList"); - missingFields = addFieldIfMissing(missingFields, stringSet, "stringSet"); - if (missingFields != null) { - throw new SafeIllegalArgumentException( - "Some required fields have not been set", SafeArg.of("missingFields", missingFields)); - } - } - - private static List addFieldIfMissing(List prev, Object fieldValue, String fieldName) { - List missingFields = prev; - if (fieldValue == null) { - if (missingFields == null) { - missingFields = new ArrayList<>(3); - } - missingFields.add(fieldName); - } - return missingFields; - } - - 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 Optional<@Safe String> optionalString = Optional.empty(); - - private List<@Safe String> stringList = new ArrayList<>(); - - private Set<@Safe String> stringSet = new LinkedHashSet<>(); - - private Builder() {} - - public Builder from(NestedTypesExample other) { - checkNotBuilt(); - optionalString(other.getOptionalString()); - stringList(other.getStringList()); - stringSet(other.getStringSet()); - return this; - } - - @JsonSetter(value = "optionalString", nulls = Nulls.SKIP) - public Builder optionalString(@Safe @Nonnull Optional<@Safe String> optionalString) { - checkNotBuilt(); - this.optionalString = Preconditions.checkNotNull(optionalString, "optionalString cannot be null"); - return this; - } - - public Builder optionalString(@Safe @Nonnull String optionalString) { - checkNotBuilt(); - this.optionalString = - Optional.of(Preconditions.checkNotNull(optionalString, "optionalString cannot be null")); - return this; - } - - @JsonSetter(value = "stringList", nulls = Nulls.SKIP) - public Builder stringList(@Safe @Nonnull Iterable stringList) { - checkNotBuilt(); - this.stringList = ConjureCollections.newArrayList( - Preconditions.checkNotNull(stringList, "stringList cannot be null")); - return this; - } - - public Builder addAllStringList(@Safe @Nonnull Iterable stringList) { - checkNotBuilt(); - ConjureCollections.addAll( - this.stringList, Preconditions.checkNotNull(stringList, "stringList cannot be null")); - return this; - } - - public Builder stringList(String stringList) { - checkNotBuilt(); - this.stringList.add(stringList); - return this; - } - - @JsonSetter(value = "stringSet", nulls = Nulls.SKIP) - public Builder stringSet(@Safe @Nonnull Iterable stringSet) { - checkNotBuilt(); - this.stringSet = ConjureCollections.newLinkedHashSet( - Preconditions.checkNotNull(stringSet, "stringSet cannot be null")); - return this; - } - - public Builder addAllStringSet(@Safe @Nonnull Iterable stringSet) { - checkNotBuilt(); - ConjureCollections.addAll( - this.stringSet, Preconditions.checkNotNull(stringSet, "stringSet cannot be null")); - return this; - } - - public Builder stringSet(String stringSet) { - checkNotBuilt(); - this.stringSet.add(stringSet); - return this; - } - - public NestedTypesExample build() { - checkNotBuilt(); - this._buildInvoked = true; - return new NestedTypesExample(optionalString, stringList, stringSet); - } - - 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/SafeExternalLongExample.java b/conjure-java-core/src/integrationInput/java/test/prefix/com/palantir/product/SafeExternalLongExample.java index c12453c4f..6b1bbdefc 100644 --- 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 @@ -206,7 +206,7 @@ public Builder addAllSafeExternalLongList(@Safe @Nonnull Iterable return this; } - public Builder safeExternalLongSet(long safeExternalLongSet) { + public Builder safeExternalLongSet(@Safe long safeExternalLongSet) { checkNotBuilt(); this.safeExternalLongSet.add(safeExternalLongSet); return this; diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderAuxiliarySettersUtils.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderAuxiliarySettersUtils.java index 9e40f1644..204506b06 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderAuxiliarySettersUtils.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderAuxiliarySettersUtils.java @@ -75,8 +75,19 @@ public static MethodSpec.Builder createOptionalSetterBuilder( public static MethodSpec.Builder createItemSetterBuilder( EnrichedField enriched, Type itemType, TypeMapper typeMapper, ClassName returnClass) { + return createItemSetterBuilder(enriched, itemType, typeMapper, returnClass, Optional.empty()); + } + + public static MethodSpec.Builder createItemSetterBuilder( + EnrichedField enriched, + Type itemType, + TypeMapper typeMapper, + ClassName returnClass, + Optional safety) { FieldSpec field = enriched.poetSpec(); - return publicSetter(enriched, returnClass).addParameter(typeMapper.getClassName(itemType), field.name); + return publicSetter(enriched, returnClass) + .addParameter( + typeMapper.getClassName(itemType).annotated(ConjureAnnotations.safety(safety)), field.name); } public static MethodSpec.Builder createMapSetterBuilder( @@ -98,14 +109,13 @@ public static MethodSpec.Builder publicSetter(EnrichedField enriched, ClassName .returns(returnClass); } - public static TypeName widenParameterIfPossible( - TypeName current, Type type, TypeMapper typeMapper, Optional safety) { + public static TypeName widenParameterIfPossible(TypeName current, Type type, TypeMapper typeMapper) { // if inner type name is external if (type.accept(TypeVisitor.IS_LIST)) { Type innerType = type.accept(TypeVisitor.LIST).getItemType(); TypeName innerTypeName = typeMapper.getClassName(innerType).box(); if (isWidenableContainedType(innerType)) { - innerTypeName = WildcardTypeName.subtypeOf(innerTypeName).annotated(ConjureAnnotations.safety(safety)); + innerTypeName = WildcardTypeName.subtypeOf(innerTypeName); } return ParameterizedTypeName.get(ClassName.get(Iterable.class), innerTypeName); } @@ -114,7 +124,7 @@ public static TypeName widenParameterIfPossible( Type innerType = type.accept(TypeVisitor.SET).getItemType(); TypeName innerTypeName = typeMapper.getClassName(innerType).box(); if (isWidenableContainedType(innerType)) { - innerTypeName = WildcardTypeName.subtypeOf(innerTypeName).annotated(ConjureAnnotations.safety(safety)); + innerTypeName = WildcardTypeName.subtypeOf(innerTypeName); } return ParameterizedTypeName.get(ClassName.get(Iterable.class), innerTypeName); @@ -126,19 +136,12 @@ public static TypeName widenParameterIfPossible( return current; } TypeName innerTypeName = typeMapper.getClassName(innerType).box(); - WildcardTypeName wildcard = - WildcardTypeName.subtypeOf(innerTypeName).annotated(ConjureAnnotations.safety(safety)); - ParameterizedTypeName p = ParameterizedTypeName.get(ClassName.get(Optional.class), wildcard); - return p; + return ParameterizedTypeName.get(ClassName.get(Optional.class), WildcardTypeName.subtypeOf(innerTypeName)); } return current; } - public static TypeName widenParameterIfPossible(TypeName current, Type type, TypeMapper typeMapper) { - return widenParameterIfPossible(current, type, typeMapper, Optional.empty()); - } - // we want to widen containers of anything that's not a primitive, a conjure reference or an optional // since we know all of those are final. public static boolean isWidenableContainedType(Type containedType) { diff --git a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderGenerator.java b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderGenerator.java index e187f3893..94ababa62 100644 --- a/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderGenerator.java +++ b/conjure-java-core/src/main/java/com/palantir/conjure/java/types/BeanBuilderGenerator.java @@ -36,6 +36,7 @@ import com.palantir.conjure.spec.FieldDefinition; import com.palantir.conjure.spec.FieldName; import com.palantir.conjure.spec.ListType; +import com.palantir.conjure.spec.LogSafety; import com.palantir.conjure.spec.MapType; import com.palantir.conjure.spec.ObjectDefinition; import com.palantir.conjure.spec.OptionalType; @@ -328,11 +329,7 @@ private MethodSpec createSetter( boolean shouldClearFirst = true; MethodSpec.Builder setterBuilder = BeanBuilderAuxiliarySettersUtils.publicSetter(enriched, builderClass) .addParameter(Parameters.nonnullParameter( - BeanBuilderAuxiliarySettersUtils.widenParameterIfPossible( - field.type, - type, - typeMapper, - SafetyUtils.getMaybeExternalSafety(enriched.conjureDef())), + BeanBuilderAuxiliarySettersUtils.widenParameterIfPossible(field.type, type, typeMapper), field.name, SafetyUtils.getMaybeExternalSafety(enriched.conjureDef()))) .addCode(verifyNotBuilt()) @@ -432,17 +429,18 @@ private boolean isByteBuffer(Type type) { private List createAuxiliarySetters(EnrichedField enriched, boolean override) { Type type = enriched.conjureDef().getType(); + Optional safety = SafetyUtils.getMaybeExternalSafety(enriched.conjureDef()); if (type.accept(TypeVisitor.IS_LIST)) { return ImmutableList.of( createCollectionSetter("addAll", enriched, override), - createItemSetter(enriched, type.accept(TypeVisitor.LIST).getItemType(), override)); + createItemSetter(enriched, type.accept(TypeVisitor.LIST).getItemType(), override, safety)); } if (type.accept(TypeVisitor.IS_SET)) { return ImmutableList.of( createCollectionSetter("addAll", enriched, override), - createItemSetter(enriched, type.accept(TypeVisitor.SET).getItemType(), override)); + createItemSetter(enriched, type.accept(TypeVisitor.SET).getItemType(), override, safety)); } if (type.accept(TypeVisitor.IS_MAP)) { @@ -494,9 +492,11 @@ private boolean isPrimitiveOptional(OptionalType optionalType) { optionalType.getItemType().accept(TypeVisitor.PRIMITIVE).get()); } - private MethodSpec createItemSetter(EnrichedField enriched, Type itemType, boolean override) { + private MethodSpec createItemSetter( + EnrichedField enriched, Type itemType, boolean override, Optional safety) { FieldSpec field = enriched.poetSpec(); - return BeanBuilderAuxiliarySettersUtils.createItemSetterBuilder(enriched, itemType, typeMapper, builderClass) + return BeanBuilderAuxiliarySettersUtils.createItemSetterBuilder( + enriched, itemType, typeMapper, builderClass, safety) .addAnnotations(ConjureAnnotations.override(override)) .addCode(verifyNotBuilt()) .addStatement("this.$1N.add($1N)", field.name) diff --git a/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ExternalImportSafetyTests.java b/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ExternalImportSafetyTests.java index 0cec087ac..2df0f09e6 100644 --- a/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ExternalImportSafetyTests.java +++ b/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ExternalImportSafetyTests.java @@ -96,8 +96,33 @@ public void testUnionAnnotations() { @Test public void testOptionalAnnotations() { - assertFieldTypeParamHasAnnotation( - SafeExternalLongExample.class, "optionalSafeExternalLong", "Long", Safe.class); + assertMethodHasAnnotation(SafeExternalLongExample.class, "getOptionalSafeExternalLong", Safe.class); + + Class builderSubclass = getMatchingSubclass(SafeExternalLongExample.class, "$Builder"); + assertFieldTypeParamHasAnnotation(builderSubclass, "optionalSafeExternalLong", "Long", Safe.class); + assertMethodParamHasAnnotation( + builderSubclass, "optionalSafeExternalLong", "optionalSafeExternalLong", Safe.class); + } + + @Test + public void testListAnnotations() { + assertMethodHasAnnotation(SafeExternalLongExample.class, "getSafeExternalLongList", Safe.class); + + Class builderSubclass = getMatchingSubclass(SafeExternalLongExample.class, "$Builder"); + assertFieldTypeParamHasAnnotation(builderSubclass, "safeExternalLongList", "Long", Safe.class); + assertMethodParamHasAnnotation(builderSubclass, "safeExternalLongList", "safeExternalLongList", Safe.class); + assertMethodParamHasAnnotation( + builderSubclass, "addAllSafeExternalLongList", "safeExternalLongList", Safe.class); + } + + @Test + public void testSetAnnotations() { + assertMethodHasAnnotation(SafeExternalLongExample.class, "getSafeExternalLongSet", Safe.class); + + Class builderSubclass = getMatchingSubclass(SafeExternalLongExample.class, "$Builder"); + assertFieldTypeParamHasAnnotation(builderSubclass, "safeExternalLongSet", "Long", Safe.class); + assertMethodParamHasAnnotation(builderSubclass, "safeExternalLongSet", "safeExternalLongSet", Safe.class); + assertMethodParamHasAnnotation(builderSubclass, "addAllSafeExternalLongSet", "safeExternalLongSet", Safe.class); } private void assertMethodHasAnnotation( diff --git a/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ObjectGeneratorTests.java b/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ObjectGeneratorTests.java index e5a1bdeec..9e11c78f8 100644 --- a/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ObjectGeneratorTests.java +++ b/conjure-java-core/src/test/java/com/palantir/conjure/java/types/ObjectGeneratorTests.java @@ -23,7 +23,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.MoreExecutors; import com.palantir.conjure.defs.Conjure; -import com.palantir.conjure.java.ConjureAnnotations; import com.palantir.conjure.java.GenerationCoordinator; import com.palantir.conjure.java.Options; import com.palantir.conjure.spec.AliasDefinition; @@ -38,11 +37,6 @@ import com.palantir.conjure.spec.Type; import com.palantir.conjure.spec.TypeDefinition; import com.palantir.conjure.spec.TypeName; -import com.squareup.javapoet.ClassName; -import com.squareup.javapoet.JavaFile; -import com.squareup.javapoet.ParameterizedTypeName; -import com.squareup.javapoet.TypeSpec; -import com.squareup.javapoet.WildcardTypeName; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -50,8 +44,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; -import java.util.Optional; -import javax.lang.model.element.Modifier; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -126,21 +118,6 @@ public void testObjectGenerator_stagedBuilder() throws IOException { assertThatFilesAreTheSame(files, REFERENCE_FILES_FOLDER); } - @Test - public void testLavanya() throws IOException { - ConjureDefinition def = Conjure.parse(ImmutableList.of(new File("src/test/resources/example.yml"))); - List files = new GenerationCoordinator( - MoreExecutors.directExecutor(), - ImmutableSet.of(new ObjectGenerator(Options.builder() - .useStagedBuilders(true) - .excludeEmptyOptionals(true) - .jetbrainsContractAnnotations(true) - .build()))) - .emit(def, tempDir); - - System.out.println(compiledFileContent(tempDir, "com/palantir/product/NestedTypesExample.java")); - } - @Test public void testObjectGenerator_excludeEmptyCollections() throws IOException { ConjureDefinition def = @@ -199,23 +176,6 @@ public void testConjureErrors() throws IOException { assertThatFilesAreTheSame(files, REFERENCE_FILES_FOLDER); } - @Test - public void testPoet() throws IOException { - WildcardTypeName wildcard = WildcardTypeName.subtypeOf(com.squareup.javapoet.TypeName.LONG.box()) - .annotated(ConjureAnnotations.safety(Optional.of(LogSafety.SAFE))); - ParameterizedTypeName paramTypeName = ParameterizedTypeName.get(ClassName.get(Optional.class), wildcard); - TypeSpec types = TypeSpec.classBuilder("PoetTestClass") - .addField(paramTypeName, "testWildcardField", Modifier.PRIVATE) - .build(); - JavaFile file = JavaFile.builder("com.palantir.test", types) - .skipJavaLangImports(true) - .indent(" ") - .build(); - file.writeTo(tempDir.toPath(), StandardCharsets.UTF_8); - assertThat(compiledFileContent(tempDir, "com/palantir/test/PoetTestClass.java")) - .doesNotContain("@Safe ? extends"); - } - @Test public void testErrorSafetyDisagreement() { ErrorGenerator errorGenerator = new ErrorGenerator(Options.builder() diff --git a/conjure-java-core/src/test/resources/example-types.yml b/conjure-java-core/src/test/resources/example-types.yml index 6a2b9a037..d1d5ef1b0 100644 --- a/conjure-java-core/src/test/resources/example-types.yml +++ b/conjure-java-core/src/test/resources/example-types.yml @@ -36,17 +36,6 @@ types: optionalSafeExternalLong: optional safeExternalLongList: list safeExternalLongSet: set - NestedTypesExample: - fields: - optionalString: - type: optional - safety: safe - stringList: - type: list - safety: safe - stringSet: - type: set - safety: safe RidExample: fields: ridValue: rid diff --git a/conjure-java-core/src/test/resources/example.yml b/conjure-java-core/src/test/resources/example.yml deleted file mode 100644 index 706a0917e..000000000 --- a/conjure-java-core/src/test/resources/example.yml +++ /dev/null @@ -1,17 +0,0 @@ -types: - imports: - SafeExternalLong: - base-type: string - external: - java: java.lang.Long - safety: safe - definitions: - default-package: com.palantir.product - objects: - NestedTypesExample: - fields: - optionalString: - type: optional - safety: safe - optionalLong: - type: optional \ No newline at end of file