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

オープン 初心者向け
#26,833 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
91/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, json, typescript
領域
documentation

調査の方向性

指定された3つのファイルを確認します: content/reference/api/extensions-sdk/HttpService.md、content/manuals/extensions/extensions-sdk/guides/oauth2-flow.md、content/manuals/scout/install.md。例を文脈に沿って確認し、修正するたびにJavaScriptまたはJSONの構文を検証します。3つの例すべてが記述どおりに解析できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Markdown
スター
4.7k
フォーク
8.6k
平均マージ
2日 8時間
マージ済み PR(30日)
188

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

docker/docs のほかの issue

docker/docs の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。