Skip to content

Conversation

@provokateurin
Copy link
Member

Summary

Add templates to indicate generic type. Not required, but very useful for OpenAPI.

Checklist

@szaimen szaimen added this to the Nextcloud 26 milestone Jan 25, 2023
@szaimen szaimen added the 2. developing Work in progress label Jan 25, 2023
@provokateurin provokateurin requested a review from come-nc February 1, 2023 07:43
@provokateurin provokateurin force-pushed the feature/generic-response-templates branch from a56f235 to 9eff3c5 Compare February 1, 2023 07:57
@blizzz blizzz mentioned this pull request Feb 1, 2023
@come-nc
Copy link
Contributor

come-nc commented Feb 2, 2023

This adds a new constraints that one cannot use setData with another type than what was used in the constructor. No idea if this is a problem or not.

/**
* response data
* @var array|object
* @var T
Copy link
Member

Choose a reason for hiding this comment

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

this weakens the type. before it was an array or object. now it can be anything

@provokateurin provokateurin marked this pull request as draft February 3, 2023 09:11
@provokateurin
Copy link
Member Author

Waiting on a solution for #36513 before continuing since this change might not be needed after all.

@provokateurin
Copy link
Member Author

I just realized this isn't possible, since psalm will complain about missing template types in every place that isn't updated.

@skjnldsv skjnldsv deleted the feature/generic-response-templates branch March 14, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants