diff --git a/fern-api-java-types/src/main/java/com/fern/IWithFilepath.java b/fern-api-java-types/src/main/java/com/fern/IWithFilepath.java deleted file mode 100644 index e812b19a8fe..00000000000 --- a/fern-api-java-types/src/main/java/com/fern/IWithFilepath.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.fern; - -interface IWithFilepath { - - String filepath(); -} diff --git a/fern-api-java-types/src/main/java/com/fern/IWithPackage.java b/fern-api-java-types/src/main/java/com/fern/IWithPackage.java new file mode 100644 index 00000000000..2837c692c3a --- /dev/null +++ b/fern-api-java-types/src/main/java/com/fern/IWithPackage.java @@ -0,0 +1,8 @@ +package com.fern; + +import java.util.Optional; + +interface IWithPackage { + + Optional _package(); +} diff --git a/fern-api-java-types/src/main/java/com/fern/NamedTypeReference.java b/fern-api-java-types/src/main/java/com/fern/NamedTypeReference.java index 56b1f187bf7..b0b859b4c7b 100644 --- a/fern-api-java-types/src/main/java/com/fern/NamedTypeReference.java +++ b/fern-api-java-types/src/main/java/com/fern/NamedTypeReference.java @@ -7,11 +7,11 @@ @Value.Immutable @StagedBuilderStyle @JsonDeserialize(as = ImmutableNamedTypeReference.class) -public interface NamedTypeReference extends IWithFilepath { +public interface NamedTypeReference extends IWithPackage { String name(); - static ImmutableNamedTypeReference.FilepathBuildStage builder() { + static ImmutableNamedTypeReference.NameBuildStage builder() { return ImmutableNamedTypeReference.builder(); } } diff --git a/fern-api-java-types/src/main/java/com/fern/WithFilepath.java b/fern-api-java-types/src/main/java/com/fern/WithFilepath.java deleted file mode 100644 index 10e138ffa35..00000000000 --- a/fern-api-java-types/src/main/java/com/fern/WithFilepath.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.fern; - -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fern.immutables.StagedBuilderStyle; -import org.immutables.value.Value; - -@Value.Immutable -@StagedBuilderStyle -@JsonDeserialize(as = ImmutableWithFilepath.class) -public interface WithFilepath extends IWithFilepath { - - static ImmutableWithFilepath.FilepathBuildStage builder() { - return ImmutableWithFilepath.builder(); - } -} diff --git a/fern-api-java-types/src/main/java/com/fern/WithPackage.java b/fern-api-java-types/src/main/java/com/fern/WithPackage.java new file mode 100644 index 00000000000..e5e0cf31b13 --- /dev/null +++ b/fern-api-java-types/src/main/java/com/fern/WithPackage.java @@ -0,0 +1,15 @@ +package com.fern; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fern.immutables.StagedBuilderStyle; +import org.immutables.value.Value; + +@Value.Immutable +@StagedBuilderStyle +@JsonDeserialize(as = ImmutableWithPackage.class) +public interface WithPackage extends IWithPackage { + + static ImmutableWithPackage.Builder builder() { + return ImmutableWithPackage.builder(); + } +} diff --git a/fern-api-java-types/src/main/java/com/fern/test/Main.java b/fern-api-java-types/src/main/java/com/fern/test/Main.java new file mode 100644 index 00000000000..c4868b58c54 --- /dev/null +++ b/fern-api-java-types/src/main/java/com/fern/test/Main.java @@ -0,0 +1,16 @@ +package com.fern.test; + +import com.fern.HttpRequest; +import com.fern.NamedTypeReference; +import com.fern.TypeReference; + +public class Main { + + public static void main(String... args) { + HttpRequest.builder() + .bodyType(TypeReference.named(NamedTypeReference.builder() + .name("") + .build())) + .build(); + } +} diff --git a/fern-api/fern.yml b/fern-api/fern.yml index 97a7035eaaa..fb5c03290a5 100644 --- a/fern-api/fern.yml +++ b/fern-api/fern.yml @@ -22,13 +22,13 @@ WithDocs: docs: optional NamedTypeReference: - extends: WithFilepath + extends: WithPackage fields: name: string -WithFilepath: +WithPackage: fields: - filepath: string + package: string Type: union: @@ -105,7 +105,7 @@ Services: BaseService: extends: - - WithFilepath + - WithPackage - WithDocs fields: name: string