Skip to content

Commit 0dcbae0

Browse files
Staacksclaude
andcommitted
Hide the servers block too, now that nothing sends a request
With the Try it out buttons gone, the block is a dropdown and two text fields whose only effect is to recompute a URL and print it. Nothing sends that URL anywhere, so it just invites a reader to edit fields that do nothing. Nothing readable goes with it. Swagger UI renders neither a server's description nor its variables', so the note on `port` - Android's 8080, iOS's 80, the walk to 8081, `remoteAccessPort` - has never actually appeared on the page; the block showed only the URL template and two bare labels. The page now carries the address shape and the two default ports in the admonition, where a reader will see them, and links to the introduction for the rest. `servers:` stays in openapi.yaml - it is part of the specification whether or not Swagger UI draws it - with a comment recording that its descriptions reach no reader, so nobody writes documentation there again expecting them to. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent a90d8ac commit 0dcbae0

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

docs/assets/stylesheets/swagger-ui-overrides.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,19 @@
4040
.swagger-ui .renderedMarkdown pre > code {
4141
padding: 5px 7px;
4242
}
43+
44+
/* The servers block is a control, not documentation: a dropdown and two text
45+
fields whose only effect is to recompute a URL that is then displayed. With
46+
no Try it out buttons there is nothing to send it to, so all it does is
47+
invite a reader to edit fields that do nothing.
48+
49+
Nothing readable is lost by hiding it. Swagger UI renders neither a server's
50+
`description` nor its variables' - the note on `port` about Android's 8080,
51+
iOS's 80, the walk to 8081 and `remoteAccessPort` has never appeared on the
52+
page - so the block shows only the URL template and two bare labels. What
53+
those descriptions say is in the admonition on api-reference.md and in the
54+
introduction. `servers:` itself stays in openapi.yaml, where it is part of
55+
the specification whether or not Swagger UI draws it. */
56+
.swagger-ui .scheme-container {
57+
display: none;
58+
}

docs/remote-interface/api-reference.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ implementations, and everything below — including the interactive requests —
1414

1515
Use the reference below to build the request, and send it with `curl`, a browser tab or
1616
your own code: enable remote access in phyphox, and use the address the app shows you.
17-
The server block below gives the shape of that URL.
17+
Every path below hangs off that address — `http://192.168.0.42:8080/get` on Android,
18+
where 8080 is the default port; on iOS the default is 80 and can usually be left out.
19+
The [introduction](index.md) covers how the requests fit together.
1820

1921
<swagger-ui src="openapi.yaml"/>

docs/remote-interface/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ info:
8888
name: GNU GPL v3
8989
identifier: GPL-3.0-only
9090

91+
# Swagger UI renders neither of the descriptions below - not the server's and
92+
# not its variables' - so none of this reaches a reader of the API reference
93+
# page, and the block itself is hidden there (see the note in
94+
# ../assets/stylesheets/swagger-ui-overrides.css). Keep it accurate anyway: it
95+
# is part of the specification, and other consumers do read it. Documentation
96+
# that readers must see belongs in `info.description` or on the page.
9197
servers:
9298
- url: http://{host}:{port}
9399
description: A phone running phyphox with remote access enabled.

0 commit comments

Comments
 (0)