Skip to content

fix: Ignore unknown JSON keys in OAuthConfig#32

Merged
chyroc merged 4 commits intocoze-dev:mainfrom
wasd96040501:feat/config_ignore_unknown
Feb 6, 2025
Merged

fix: Ignore unknown JSON keys in OAuthConfig#32
chyroc merged 4 commits intocoze-dev:mainfrom
wasd96040501:feat/config_ignore_unknown

Conversation

@wasd96040501
Copy link
Contributor

feat: ignore unknwon json key when load config

@coderabbitai
Copy link

coderabbitai bot commented Feb 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces the @JsonIgnoreProperties(ignoreUnknown = true) annotation to the OAuthConfig class, enabling the Jackson library to ignore unmapped JSON properties during deserialization. Additionally, the version of the coze-api artifact has been updated from 0.2.2 to 0.2.3 in the pom.xml files of both the main project and the example project. The VERSION constant in the UserAgentInterceptor class has also been updated to reflect this new version. No other functional changes were made.

Changes

File Path Change Summary
api/src/main/java/.../OAuthConfig.java Added @JsonIgnoreProperties(ignoreUnknown = true) to the class to ignore unmapped JSON properties.
api/pom.xml Updated artifact version from 0.2.2 to 0.2.3.
api/src/main/java/.../UserAgentInterceptor.java Updated VERSION constant from "0.2.2" to "0.2.3".
example/pom.xml Updated coze-api dependency version from 0.2.2 to 0.2.3.

Possibly related PRs

  • chore: Release version 0.1.3 #11: The changes in the main PR, which involve updating the version number in the pom.xml file, are related to the changes in the retrieved PR that also update the version number in a similar file.
  • feat: Create OAuth client from config & Bump version to 0.2.1 #29: The changes in the main PR, which involve adding a JSON annotation to the OAuthConfig class, are related to the retrieved PR as both involve modifications to the OAuthConfig class, with the retrieved PR introducing the class itself.

Poem

I'm a rabbit with hops so light,
Coding in the moonlit night.
Unknown fields no longer cause a fright,
They vanish like carrots out of sight.
Happy bytes and hoppy delight!
🥕🐇

Tip

🌐 Web search-backed reviews and chat
  • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
  • You can disable this feature by setting web_search: false in the knowledge_base settings.
  • Please share any feedback in the Discord discussion.

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25408d0 and da320d1.

📒 Files selected for processing (3)
  • api/pom.xml (2 hunks)
  • api/src/main/java/com/coze/openapi/service/utils/UserAgentInterceptor.java (1 hunks)
  • example/pom.xml (1 hunks)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@chyroc chyroc added the feature label Feb 6, 2025
@chyroc chyroc changed the title feat: ignore unknwon json key when load config fix: Ignore unknown JSON keys in OAuthConfig Feb 6, 2025
@chyroc chyroc added bug Something isn't working and removed feature labels Feb 6, 2025
@chyroc chyroc merged commit 971b3d7 into coze-dev:main Feb 6, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants