[go: nahoru, domu]

Page MenuHomePhabricator

OpenAPI docs incorrectly show response examples for empty response bodies
Closed, ResolvedPublic

Description

Some responses are expected to have an empty response body and in such cases our docs should simply not show examples for response bodies. They currently show an example saying "string" which is confusing.

Example:

image.png (267×788 px, 20 KB)

in https://doc.wikimedia.org/Wikibase/master/js/rest-api/#/items/getItem

This was likely caused by an update to the latest version of swagger-ui, the software that generates the docs based on the spec.

Possible solutions:

Event Timeline

Jakob_WMDE renamed this task from OpenAPI docs show response examples where there shouldn't be any to OpenAPI docs incorrectly show response examples for empty response bodies.Jan 2 2024, 4:18 PM

Apparently this has been fixed in v5.11.10 of the swagger-ui: https://github.com/swagger-api/swagger-ui/issues/9199#issuecomment-1981110616
We should try updating to see if this fixes our issue.

Change #1041419 had a related patch set uploaded (by Ollie Shotton; author: Ollie Shotton):

[mediawiki/extensions/Wikibase@master] REST: Update swagger-ui 5.9.4 -> 5.17.14

https://gerrit.wikimedia.org/r/1041419

Change #1041419 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Update swagger-ui 5.9.4 -> 5.17.14

https://gerrit.wikimedia.org/r/1041419