Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dev): Use non-ambigous array syntax in OpenAPI tutorial #12231

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions developer_manual/client_apis/OCS/ocs-openapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ For those endpoints returning ``[]`` in PHP is a problem because the consumer wi
If you are not able to use ``null`` for whatever reason, use ``new \stdClass()`` instead.
It will get correctly converted into ``{}`` in the JSON response on Nextcloud 28 and later.

If you are working with an existing API where you can not break compatibility, you can also type the result as ``array<empty>``.
If you are working with an existing API where you can not break compatibility, you can also type the result as ``list<empty>``.

.. collapse:: Examples

Expand Down Expand Up @@ -178,7 +178,7 @@ If you are working with an existing API where you can not break compatibility, y
}

/**
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}>
* @return DataResponse<Http::STATUS_OK, list<empty>, array{}>
*/
public function someControllerMethod() {
...
Expand Down Expand Up @@ -719,7 +719,7 @@ Now you have to add the correct return type annotation:

class Capabilities implements ICapability {
/**
* @return array{todo: array{supported-operations: string[], emojis-supported: bool}}
* @return array{todo: array{supported-operations: list<string>, emojis-supported: bool}}
*/
public function getCapabilities() {
return [
Expand Down
Loading