Skip to content

Commit

Permalink
fix: Updated GitHub spec. Fixed issues with it.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Oct 18, 2024
1 parent 5c1c91f commit e8a63a2
Show file tree
Hide file tree
Showing 2,761 changed files with 75,561 additions and 19,172 deletions.
9,139 changes: 6,668 additions & 2,471 deletions specs/github.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/libs/AutoSDK/Models/AnyOfData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public static AnyOfData FromSchemaContext(SchemaContext context)
? children.Select((x, i) => PropertyData.Default with
{
Type = x.TypeData ?? TypeData.Default,
Name = useSmartNames
Name = useSmartNames && (x.TypeData ?? TypeData.Default).CSharpTypeWithoutNullability.StartsWith("global::System.", StringComparison.Ordinal) != true
? SmartNamedAnyOfNames.ComputeSmartName(
(x.TypeData ?? TypeData.Default).ShortCSharpTypeWithoutNullability,
className)
Expand Down
14 changes: 9 additions & 5 deletions src/libs/AutoSDK/Sources/Sources.AnyOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ public static string GenerateAnyOf(
anyOfData.Count > 1 ||
(!string.IsNullOrWhiteSpace(anyOfData.Name) &&
anyOfData.DiscriminatorType != null &&
anyOfData.DiscriminatorPropertyName != null) ? $@"
anyOfData.DiscriminatorPropertyName != null &&
allTypes.All(x => !string.IsNullOrWhiteSpace(x.DiscriminatorValue))) ? $@"
{string.Empty.ToXmlDocumentationSummary(level: 8)}
public {classNameWithoutTypes}(
{(string.IsNullOrWhiteSpace(anyOfData.Name) ||
anyOfData.DiscriminatorType == null ||
anyOfData.DiscriminatorPropertyName == null ? " " : $@"
anyOfData.DiscriminatorPropertyName == null ||
allTypes.Any(x => string.IsNullOrWhiteSpace(x.DiscriminatorValue)) ? " " : $@"
{anyOfData.DiscriminatorType.Value.CSharpTypeWithoutNullability}{anyOfData.DiscriminatorPropertyName}? {anyOfData.DiscriminatorPropertyName.ToParameterName()},
")}
{allTypes.Select(x => $@"
Expand All @@ -57,7 +59,8 @@ public static string GenerateAnyOf(
{{
{(string.IsNullOrWhiteSpace(anyOfData.Name) ||
anyOfData.DiscriminatorType == null ||
anyOfData.DiscriminatorPropertyName == null ? " " : $@"
anyOfData.DiscriminatorPropertyName == null ||
allTypes.Any(x => string.IsNullOrWhiteSpace(x.DiscriminatorValue)) ? " " : $@"
{anyOfData.DiscriminatorPropertyName} = {anyOfData.DiscriminatorPropertyName.ToParameterName()};
")}
{allTypes.Select(x => $@"
Expand All @@ -78,7 +81,8 @@ namespace {anyOfData.Namespace}
{{
{(string.IsNullOrWhiteSpace(anyOfData.Name) ||
anyOfData.DiscriminatorType == null ||
anyOfData.DiscriminatorPropertyName == null ? " " : $@"
anyOfData.DiscriminatorPropertyName == null ||
allTypes.Any(x => string.IsNullOrWhiteSpace(x.DiscriminatorValue)) ? " " : $@"
{string.Empty.ToXmlDocumentationSummary(level: 8)}
public {anyOfData.DiscriminatorType.Value.CSharpTypeWithoutNullability}{anyOfData.DiscriminatorPropertyName}? {anyOfData.DiscriminatorPropertyName} {{ get; }}
")}
Expand All @@ -95,7 +99,7 @@ namespace {anyOfData.Namespace}
[global::System.Diagnostics.CodeAnalysis.MemberNotNullWhen(true, nameof({x.Name}))]
#endif
public bool Is{x.Name} => {x.Name} != null;
{(className != x.Type.CSharpTypeWithoutNullability ? $@"
{(className != x.Type.CSharpTypeWithoutNullability && x.Type.CSharpTypeWithoutNullability.StartsWith("global::System.Collections.Generic.IList", StringComparison.Ordinal) != true ? $@"
{string.Empty.ToXmlDocumentationSummary(level: 8)}
public static implicit operator {className}({x.Type.CSharpTypeWithoutNullability} value) => new {className}(value);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/AutoSDK/Sources/Sources.JsonConverters.AnyOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static string GenerateAnyOfJsonConverter(
})
.ToImmutableArray().AsEquatableArray()
: anyOfData.Properties;
var read = anyOfData.DiscriminatorType != null ? $@"
var read = anyOfData.DiscriminatorType != null && allTypes.All(x => !string.IsNullOrWhiteSpace(x.DiscriminatorValue)) ? $@"
var readerCopy = reader;
{(anyOfData.IsTrimming ? $@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public partial interface IMigrationsClient
/// <summary>
/// Cancel an import<br/>
/// Stop an import for a repository.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public partial interface IMigrationsClient
/// Get commit authors<br/>
/// Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot &lt;hubot@12341234-abab-fefe-8787-fedcba987654&gt;`.<br/>
/// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public partial interface IMigrationsClient
/// <summary>
/// Get an import status<br/>
/// View the progress of an import.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).<br/>
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).<br/>
/// **Import status**<br/>
/// This section includes details about the possible values of the `status` field of the Import Progress response.<br/>
/// An import that does not have errors will progress through these steps:<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ public partial interface IMigrationsClient
/// <summary>
/// Get large files<br/>
/// List files larger than 100MB found during the import<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ public partial interface IMigrationsClient
/// Map a commit author<br/>
/// Update an author's identity for the import. Your application can continue updating authors any time before you push<br/>
/// new commits to the repository.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand All @@ -29,7 +30,8 @@ public partial interface IMigrationsClient
/// Map a commit author<br/>
/// Update an author's identity for the import. Your application can continue updating authors any time before you push<br/>
/// new commits to the repository.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public partial interface IMigrationsClient
/// is powered by [Git LFS](https://git-lfs.com).<br/>
/// You can learn more about our LFS feature and working with large files [on our help<br/>
/// site](https://docs.github.com/repositories/working-with-files/managing-large-files).<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand All @@ -31,7 +32,8 @@ public partial interface IMigrationsClient
/// is powered by [Git LFS](https://git-lfs.com).<br/>
/// You can learn more about our LFS feature and working with large files [on our help<br/>
/// site](https://docs.github.com/repositories/working-with-files/managing-large-files).<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public partial interface IMigrationsClient
/// Start a source import to a GitHub repository using GitHub Importer.<br/>
/// Importing into a GitHub repository with GitHub Actions enabled is not supported and will<br/>
/// return a status `422 Unprocessable Entity` response.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand All @@ -29,7 +30,8 @@ public partial interface IMigrationsClient
/// Start a source import to a GitHub repository using GitHub Importer.<br/>
/// Importing into a GitHub repository with GitHub Actions enabled is not supported and will<br/>
/// return a status `422 Unprocessable Entity` response.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public partial interface IMigrationsClient
/// Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will<br/>
/// have the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array.<br/>
/// You can select the project to import by providing one of the objects in the `project_choices` array in the update request.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand All @@ -33,7 +34,8 @@ public partial interface IMigrationsClient
/// Some servers (e.g. TFS servers) can have several projects at a single URL. In those cases the import progress will<br/>
/// have the status `detection_found_multiple` and the Import Progress response will include a `project_choices` array.<br/>
/// You can select the project to import by providing one of the objects in the `project_choices` array in the update request.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ partial void ProcessMigrationsCancelImportResponseContent(
/// <summary>
/// Cancel an import<br/>
/// Stop an import for a repository.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ partial void ProcessMigrationsGetCommitAuthorsResponseContent(
/// Get commit authors<br/>
/// Each type of source control system represents authors in a different way. For example, a Git commit author has a display name and an email address, but a Subversion commit author just has a username. The GitHub Importer will make the author information valid, but the author might not be correct. For example, it will change the bare Subversion username `hubot` into something like `hubot &lt;hubot@12341234-abab-fefe-8787-fedcba987654&gt;`.<br/>
/// This endpoint and the [Map a commit author](https://docs.github.com/rest/migrations/source-imports#map-a-commit-author) endpoint allow you to provide correct Git author information.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).
/// </summary>
/// <param name="owner"></param>
/// <param name="repo"></param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ partial void ProcessMigrationsGetImportStatusResponseContent(
/// <summary>
/// Get an import status<br/>
/// View the progress of an import.<br/>
/// **Warning:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).<br/>
/// &gt; [!WARNING]<br/>
/// &gt; **Deprecation notice:** Due to very low levels of usage and available alternatives, this endpoint is deprecated and will no longer be available from 00:00 UTC on April 12, 2024. For more details and alternatives, see the [changelog](https://gh.io/source-imports-api-deprecation).<br/>
/// **Import status**<br/>
/// This section includes details about the possible values of the `status` field of the Import Progress response.<br/>
/// An import that does not have errors will progress through these steps:<br/>
Expand Down
Loading

0 comments on commit e8a63a2

Please sign in to comment.