Skip to content

Commit

Permalink
Recognize when reference types are arrays.
Browse files Browse the repository at this point in the history
Fixes #5.
  • Loading branch information
christiandeange committed Feb 10, 2024
1 parent 4b25a8b commit f6d414f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 10 additions & 10 deletions bluesky/api/bluesky.api
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public final class app/bsky/actor/FeedViewPref$Companion {

public final class app/bsky/actor/GetPreferencesResponse {
public static final field Companion Lapp/bsky/actor/GetPreferencesResponse$Companion;
public fun <init> (Lapp/bsky/actor/PreferencesUnion;)V
public final fun component1 ()Lapp/bsky/actor/PreferencesUnion;
public final fun copy (Lapp/bsky/actor/PreferencesUnion;)Lapp/bsky/actor/GetPreferencesResponse;
public static synthetic fun copy$default (Lapp/bsky/actor/GetPreferencesResponse;Lapp/bsky/actor/PreferencesUnion;ILjava/lang/Object;)Lapp/bsky/actor/GetPreferencesResponse;
public fun <init> (Lkotlinx/collections/immutable/ImmutableList;)V
public final fun component1 ()Lkotlinx/collections/immutable/ImmutableList;
public final fun copy (Lkotlinx/collections/immutable/ImmutableList;)Lapp/bsky/actor/GetPreferencesResponse;
public static synthetic fun copy$default (Lapp/bsky/actor/GetPreferencesResponse;Lkotlinx/collections/immutable/ImmutableList;ILjava/lang/Object;)Lapp/bsky/actor/GetPreferencesResponse;
public fun equals (Ljava/lang/Object;)Z
public final fun getPreferences ()Lapp/bsky/actor/PreferencesUnion;
public final fun getPreferences ()Lkotlinx/collections/immutable/ImmutableList;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
Expand Down Expand Up @@ -564,12 +564,12 @@ public final class app/bsky/actor/ProfileViewDetailed$Companion {

public final class app/bsky/actor/PutPreferencesRequest {
public static final field Companion Lapp/bsky/actor/PutPreferencesRequest$Companion;
public fun <init> (Lapp/bsky/actor/PreferencesUnion;)V
public final fun component1 ()Lapp/bsky/actor/PreferencesUnion;
public final fun copy (Lapp/bsky/actor/PreferencesUnion;)Lapp/bsky/actor/PutPreferencesRequest;
public static synthetic fun copy$default (Lapp/bsky/actor/PutPreferencesRequest;Lapp/bsky/actor/PreferencesUnion;ILjava/lang/Object;)Lapp/bsky/actor/PutPreferencesRequest;
public fun <init> (Lkotlinx/collections/immutable/ImmutableList;)V
public final fun component1 ()Lkotlinx/collections/immutable/ImmutableList;
public final fun copy (Lkotlinx/collections/immutable/ImmutableList;)Lapp/bsky/actor/PutPreferencesRequest;
public static synthetic fun copy$default (Lapp/bsky/actor/PutPreferencesRequest;Lkotlinx/collections/immutable/ImmutableList;ILjava/lang/Object;)Lapp/bsky/actor/PutPreferencesRequest;
public fun equals (Ljava/lang/Object;)Z
public final fun getPreferences ()Lapp/bsky/actor/PreferencesUnion;
public final fun getPreferences ()Lkotlinx/collections/immutable/ImmutableList;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ fun LexiconSingleReference.typeName(
if (objectRef == "main") "" else objectRef.capitalized() +
if (isUnionType) "Union" else ""

return ClassName(packageName, className)
val referenceClassName = ClassName(packageName, className)

return if (lexiconRefType is LexiconArray) {
TypeNames.ReadOnlyList.parameterizedBy(referenceClassName)
} else {
referenceClassName
}
}

fun String.parseLexiconRef(source: LexiconDocument): Pair<String, String> {
Expand Down

0 comments on commit f6d414f

Please sign in to comment.