Skip to content

Don't emit deprecation warnings (coming from openapi-generated code) #715

Open
@MahdiBM

Description

@MahdiBM

Motivation

/__w/penny-bot/penny-bot/Lambdas/GitHubAPI/GeneratedSources/Types.swift:2886:22: warning: 'hasDownloads' is deprecated
 2884 |                 self.hasWiki = hasWiki
 2885 |                 self.hasPages = hasPages
 2886 |                 self.hasDownloads = hasDownloads
      |                      `- warning: 'hasDownloads' is deprecated
 2887 |                 self.hasDiscussions = hasDiscussions
 2888 |                 self.archived = archived
/__w/penny-bot/penny-bot/Lambdas/GitHubAPI/GeneratedSources/Types.swift:2900:22: warning: 'useSquashPrTitleAsDefault' is deprecated
 2898 |                 self.deleteBranchOnMerge = deleteBranchOnMerge
 2899 |                 self.allowUpdateBranch = allowUpdateBranch
 2900 |                 self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault
      |                      `- warning: 'useSquashPrTitleAsDefault' is deprecated
 2901 |                 self.squashMergeCommitTitle = squashMergeCommitTitle
 2902 |                 self.squashMergeCommitMessage = squashMergeCommitMessage
/__w/penny-bot/penny-bot/Lambdas/GitHubAPI/GeneratedSources/Types.swift:2886:22: warning: 'hasDownloads' is deprecated
 2884 |                 self.hasWiki = hasWiki
 2885 |                 self.hasPages = hasPages
 2886 |                 self.hasDownloads = hasDownloads
      |                      `- warning: 'hasDownloads' is deprecated
 2887 |                 self.hasDiscussions = hasDiscussions
 2888 |                 self.archived = archived
/__w/penny-bot/penny-bot/Lambdas/GitHubAPI/GeneratedSources/Types.swift:2900:22: warning: 'useSquashPrTitleAsDefault' is deprecated
 2898 |                 self.deleteBranchOnMerge = deleteBranchOnMerge
 2899 |                 self.allowUpdateBranch = allowUpdateBranch
 2900 |                 self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault
      |                      `- warning: 'useSquashPrTitleAsDefault' is deprecated
 2901 |                 self.squashMergeCommitTitle = squashMergeCommitTitle
 2902 |                 self.squashMergeCommitMessage = squashMergeCommitMessage
/__w/penny-bot/penny-bot/Lambdas/GitHubAPI/GeneratedSources/Types.swift:2886:22: warning: 'hasDownloads' is deprecated
 2884 |                 self.hasWiki = hasWiki
 2885 |                 self.hasPages = hasPages
 2886 |                 self.hasDownloads = hasDownloads
      |                      `- warning: 'hasDownloads' is deprecated
 2887 |                 self.hasDiscussions = hasDiscussions
 2888 |                 self.archived = archived
/__w/penny-bot/penny-bot/Lambdas/GitHubAPI/GeneratedSources/Types.swift:2900:22: warning: 'useSquashPrTitleAsDefault' is deprecated
 2898 |                 self.deleteBranchOnMerge = deleteBranchOnMerge
 2899 |                 self.allowUpdateBranch = allowUpdateBranch
 2900 |                 self.useSquashPrTitleAsDefault = useSquashPrTitleAsDefault
      |                      `- warning: 'useSquashPrTitleAsDefault' is deprecated
 2901 |                 self.squashMergeCommitTitle = squashMergeCommitTitle
 2902 |                 self.squashMergeCommitMessage = squashMergeCommitMessage

Proposed solution

I think we could have settings like "upgrade_deprecations_to_unavailabilities" or "don't_mark_as_deprecated_at_all".
Or maybe if we annotate the initializer with the deprecations as well, we can somehow manage not breaking users while also not emitting warnings? we might need 2 inits, one with all properties including deprecateds, and one with no deprecated parameters in it.

Alternatives considered

Live with the warnings?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureNew feature.status/triageCollecting information required to triage the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions