Skip to content

Commit

Permalink
Revert "improvement: rename package to filepath (#12)"
Browse files Browse the repository at this point in the history
This reverts commit 69a1979.
  • Loading branch information
zachkirsch committed Apr 11, 2022
1 parent 69a1979 commit fb59213
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 27 deletions.
6 changes: 0 additions & 6 deletions fern-api-java-types/src/main/java/com/fern/IWithFilepath.java

This file was deleted.

8 changes: 8 additions & 0 deletions fern-api-java-types/src/main/java/com/fern/IWithPackage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.fern;

import java.util.Optional;

interface IWithPackage {

Optional<String> _package();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
15 changes: 0 additions & 15 deletions fern-api-java-types/src/main/java/com/fern/WithFilepath.java

This file was deleted.

15 changes: 15 additions & 0 deletions fern-api-java-types/src/main/java/com/fern/WithPackage.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
16 changes: 16 additions & 0 deletions fern-api-java-types/src/main/java/com/fern/test/Main.java
Original file line number Diff line number Diff line change
@@ -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();
}
}
8 changes: 4 additions & 4 deletions fern-api/fern.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ WithDocs:
docs: optional<string>

NamedTypeReference:
extends: WithFilepath
extends: WithPackage
fields:
name: string

WithFilepath:
WithPackage:
fields:
filepath: string
package: string

Type:
union:
Expand Down Expand Up @@ -105,7 +105,7 @@ Services:

BaseService:
extends:
- WithFilepath
- WithPackage
- WithDocs
fields:
name: string
Expand Down

0 comments on commit fb59213

Please sign in to comment.