Three code examples do not parse (HttpService, OAuth 2.0 flow, Scout config.json on Windows)

Offen Anfängerfreundlich
#26,833 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
91/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
javascript, json, typescript
Bereich
documentation

Rechercherichtung

Überprüfe die drei genannten Dateien: content/reference/api/extensions-sdk/HttpService.md, content/manuals/extensions/extensions-sdk/guides/oauth2-flow.md und content/manuals/scout/install.md. Prüfe die Beispiele im Kontext und verifiziere nach jeder Korrektur die JavaScript- oder JSON-Syntax. Fertig ist die Aufgabe, wenn alle drei Beispiele in der vorliegenden Form geparst werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Is this a docs issue?
  • My issue is about the documentation content or website
Type of issue

Information is incorrect

Description

Three code examples can't be used as written, because they don't parse:

  1. HttpService get example (content/reference/api/extensions-sdk/HttpService.md, around line 25):
    .then((value: any) => console.log(value) is missing the closing ) and ;. The other examples on the same page end with console.log(value));.
  2. OAuth 2.0 flow (content/manuals/extensions/extensions-sdk/guides/oauth2-flow.md, around line 48): the openExternal URL is a double-quoted string that spans four lines, which is an unterminated string literal in JS/TS. ${REDIRECT_URI} inside it would only be substituted in a template literal.
  3. Scout config.json on Windows (content/manuals/scout/install.md, around line 111):
    "C:\Users\<USER>\.docker\scout" uses single backslashes. In JSON \U, \<, \. and \s are invalid escapes, so the file can't be parsed. They need to be \\.
Location
Suggestion
  1. Close the call: .then((value: any) => console.log(value));
  2. Use one template literal: `https://authorization-server.com/authorize?response_type=code&client_id=...&redirect_uri=${REDIRECT_URI}`
  3. Double the backslashes: "C:\\Users\\<USER>\\.docker\\scout"

I have a branch with these three one-line fixes ready and can open a PR that links this issue if a maintainer is OK with it. Following the moby AI policy: I found these with an AI coding assistant (a parser run over the docs' code blocks) and checked each one by hand.

Vorherrschende Sprache
Markdown
Sterne
4.7k
Forks
8.6k
Ø Merge
2 T. 8 Std.
Gemergte PRs (30 T.)
188

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus docker/docs

Alle Issues in docker/docs

Ähnliche Issues

Weitere Issues zu Documentation

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.