nextcloud / ocs_api_viewer

3 stars 1 forks source link

List of children not shown #20

Closed nickvergessen closed 6 months ago

nickvergessen commented 8 months ago

Problematic controller: https://github.com/nextcloud/spreed/blob/4c5128dc22af05217df9e9d044515dbf921e05dc/lib/Controller/ReactionController.php#L63

*@return DataResponse<Http::STATUS_OK|Http::STATUS_CREATED, array<string, TalkReaction[]>

Resulting data: https://github.com/nextcloud/spreed/blob/bac9eb8652e009c8e13b52d0c6815bc0432740e0/openapi.json#L8496-L8504

                                            "properties": {
                                                "meta": {
                                                    "$ref": "#/components/schemas/OCSMeta"
                                                },
                                                "data": {
                                                    "type": "object",
                                                    "additionalProperties": {
                                                        "type": "array",
                                                        "items": {
                                                            "$ref": "#/components/schemas/Reaction"
                                                        }
                                                    }
                                                }
                                            }

The sample shows the details, but the schema is not visible in the main area: grafik

Mostlikely an upstream bug again?

nickvergessen commented 8 months ago

Any clever idea for a workaround how I could name sample "emojis" here or even add documentation about what the key of the array is?

provokateurin commented 8 months ago

https://github.com/nextcloud/openapi-extractor/issues/10 would make it possible to write comments inside type aliases. You'd have to define the response type as an alias, but then it will work.

nickvergessen commented 8 months ago

That works for me

provokateurin commented 8 months ago

But it needs to be implemented first

provokateurin commented 6 months ago

image In the latest version this is displayed correctly, can we close this?