Skip to content

Conversation

@Kwok-he-Chu
Copy link
Member

@Kwok-he-Chu Kwok-he-Chu commented Oct 8, 2024

Description
This PR addresses the [Obsolete]-tag in the model and service mustache templates. These should only be shown if the message is available in the specs.

Tested scenarios

Example with CardDetails.cupsecureplusSmscode

Before:

[Obsolete("Deprecated since Adyen Checkout API v -")]

After:

[Obsolete("")]

I kept the template easy-to-read, I didn't want to make an exception for the empty case, e.g. just[Obsolete] without the double quotes and brackets ("")


Example with just the deprecation version:

[Obsolete("Deprecated since Adyen Checkout API v37.")]
        Model.Checkout.PaymentSetupResponse PaymentSession(PaymentSetupRequest paymentSetupRequest = default, RequestOptions requestOptions = default);

Example with the deprecation message and version:

[Obsolete("Deprecated since Adyen Checkout API v49. Use `storedPaymentMethodId` instead.")]
        public string RecurringDetailReference { get; set; }

@Kwok-he-Chu Kwok-he-Chu requested a review from a team October 8, 2024 13:04
@Kwok-he-Chu Kwok-he-Chu requested a review from a team as a code owner October 8, 2024 13:04
Copy link
Contributor

@gcatanese gcatanese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are fine.

Keep into consideration that for the endpoints there is the x-deprecatedInVersion extension without vendorExtensions.x-deprecatedMessage, in this case the formatting could look wrong.
Suggestions:

  • check also if x-deprecatedMessage is available
  • format the message differently, instead of using - use a .

@Kwok-he-Chu Kwok-he-Chu requested a review from gcatanese October 8, 2024 14:32
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 8, 2024

Copy link
Contributor

@gcatanese gcatanese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are good

If you like check the changes in Java app where I have updated the templates to check separately for the 2 extensions (without assuming message is provided when version is found)

Adyen/adyen-java-api-library@be75d2d

@Kwok-he-Chu Kwok-he-Chu merged commit 5ce97d0 into main Oct 11, 2024
6 checks passed
@Kwok-he-Chu Kwok-he-Chu deleted the add-obsolete-message-if-exists branch October 11, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants