Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/openapi/v2.yamlにbotを弾くクエリパラメータの記述を追加 #1103

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

w4mally
Copy link

@w4mally w4mally commented Jan 13, 2025

User description

タイトルの通りです。
他の部分を参考に見よう見まねで書きました。


PR Type

Documentation


Description

  • v2.yamlに新しいクエリパラメータbotを追加。

  • botパラメータでボットを除外するオプションを提供。

  • パラメータのデフォルト動作を明記。


Changes walkthrough 📝

Relevant files
Documentation
v2.yaml
ボット除外用クエリパラメータを追加                                                                               

docs/openapi/v2.yaml

  • 新しいクエリパラメータbotを追加。
  • botパラメータの説明とスキーマを記述。
  • ボットを除外するオプションを提供。
+9/-0     

💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

@w4mally w4mally requested a review from ikura-hamu January 13, 2025 15:57
@w4mally w4mally linked an issue Jan 13, 2025 that may be closed by this pull request
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Documentation Clarity

The description for the bot query parameter should be reviewed to ensure it is clear and unambiguous, particularly for non-Japanese readers or developers unfamiliar with the context.

- name: bot
  in: query
  required: false
  schema:
    type: boolean
  description: |
    falseの場合botを除外します。
    デフォルトではbotも含めます。

Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
General
クエリパラメータのデフォルト値を明示的に指定することで、意図を明確にします。


parametersセクションに追加されたbotクエリパラメータのデフォルト値が明確に指定されていないため、defaultフィールドを追加してデフォルト値を明示してください。

docs/openapi/v2.yaml [170-176]

 - name: bot
   in: query
   required: false
   schema:
     type: boolean
+    default: true
   description: |
     falseの場合botを除外します。
     デフォルトではbotも含めます。
Suggestion importance[1-10]: 9

Why: Adding a default field to the bot query parameter clarifies its intended behavior and ensures consistency in its usage. This is a significant improvement for API documentation, as it removes ambiguity and aids developers in understanding the default behavior of the parameter.

9

Copy link
Member

@ikura-hamu ikura-hamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okです。task generateを実行するとコード生成が実行されるので、それをやってからこのブランチで開発を進めてください

@w4mally
Copy link
Author

w4mally commented Jan 25, 2025

users.goにクエリパラメータの取得部分を書きました。
あとはuserInfoからusersをappendする前に?bot=falseかつそのユーザーがbotならappendせずに次のユーザーを見る、みたいな処理を書けばいいのかなと思ったのですが、user.go内のUserInfoの定義などを見てもユーザーがbotかどうかを判別する方法が分からなかったのでいったん作業途中でpushしました。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GET /usersでbotを除外するパラメータを付ける
2 participants