Skip to content

Commit

Permalink
LanguageLinkInfo.Autonym may be missing if user has not opt-in for it.
Browse files Browse the repository at this point in the history
  • Loading branch information
CXuesong committed Aug 30, 2024
1 parent 6c98415 commit 75d999f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WikiClientLibrary.Wikibase/Claim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ internal Contracts.Reference ToContract()
/// </summary>
/// <remarks>
/// To compare the equality of two snaks' values, consider using
/// <see cref="JToken.DeepEquals(JToken,JToken)"/> on <see cref="RawDataValue"/>.
/// <see cref="JsonNode.DeepEquals"/> on <see cref="RawDataValue"/>.
/// </remarks>
public sealed class Snak
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public enum LanguageLinkProperties
LanguageName = 2,

/// <summary>Adds the native language name. (MW 1.23+)</summary>
Autonym = 4
Autonym = 4,

}

Expand All @@ -116,17 +116,20 @@ public enum LanguageLinkProperties
public sealed class LanguageLinkInfo
{

/// <see cref="LanguageLinkProperties.LanguageName"/>
[JsonPropertyName("lang")]
public required string Language { get; init; }

/// <summary>URL of the language link target.</summary>
/// <remarks>In rare cases, such as when the <see cref="Title"/> is malformed, this property can be <c>null</c>.</remarks>
/// <see cref="LanguageLinkProperties.Url"/>
public string? Url { get; init; }

/// <summary>
/// Autonym of the language.
/// </summary>
public required string Autonym { get; init; }
/// <see cref="LanguageLinkProperties.Autonym"/>
public string? Autonym { get; init; }

/// <summary>
/// Title of the page in the specified language.
Expand Down

0 comments on commit 75d999f

Please sign in to comment.