-
Notifications
You must be signed in to change notification settings - Fork 625
[Ai] Fix anyOf
refdoc
#7066
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
[Ai] Fix anyOf
refdoc
#7066
Conversation
The sample code was not correctly enclosed in backticks (`), causing the code to be incorrectly rendered.
Firebase AI Mock Responses Check
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @rlazo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses a minor but important documentation issue by fixing the rendering of a code sample for the Schema.anyOf
method. The change ensures that the example code is correctly displayed, improving the clarity and usability of the API reference for developers.
Highlights
- Documentation Fix: Corrected the formatting of a code example for the
Schema.anyOf
method inSchema.kt
to ensure proper rendering within the reference documentation.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
Javadoc Changes:--- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/ai/type/Schema.Companion.html 2025-06-23 13:24:29.713298879 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/ai/type/Schema.Companion.html 2025-06-23 13:20:58.552986880 +0000
@@ -104,9 +104,7 @@
<pre class="api-signature no-pretty-print">public static final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/ai/type/Schema.html">Schema</a> <a href="/docs/reference/android/com/google/firebase/ai/type/Schema.Companion.html#anyOf(kotlin.collections.List)">anyOf</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/util/List.html">List</a><@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/ai/type/Schema.html">Schema</a>> schemas)</pre>
<p>Returns a <code><a href="/docs/reference/android/com/google/firebase/ai/type/Schema.html">Schema</a></code> representing a value that must conform to <em>any</em> (one of) the provided sub-schema.</p>
<p>Example: A field that can hold either a simple userID or a more detailed user object.</p>
- <p>Schema.anyOf( listOf( Schema.integer(description = "User ID"), Schema.obj(mapOf(</p>
- <pre class="prettyprint"> "userID" to Schema.integer(description = "User ID"),<br> "username" to Schema.string(description = "Username")</pre>
- <p>)) )</p>
+ <pre class="prettyprint">Schema.anyOf( listOf( Schema.integer(description = "User ID"), Schema.obj( mapOf(<br> "userID" to Schema.integer(description = "User ID"),<br> "username" to Schema.string(description = "Username")<br>)))</pre>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup> --- /home/runner/diff/original/firebase-kotlindoc/android/com/google/firebase/ai/type/Schema.html 2025-06-23 13:24:29.721298815 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/android/com/google/firebase/ai/type/Schema.html 2025-06-23 13:20:58.558986833 +0000
@@ -285,9 +285,7 @@
<pre class="api-signature no-pretty-print">public static final @<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/ai/type/Schema.html">Schema</a> <a href="/docs/reference/android/com/google/firebase/ai/type/Schema.Companion.html#anyOf(kotlin.collections.List)">anyOf</a>(@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/kotlin/java/util/List.html">List</a><@<a href="https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html">NonNull</a> <a href="/docs/reference/android/com/google/firebase/ai/type/Schema.html">Schema</a>> schemas)</pre>
<p>Returns a <code><a href="/docs/reference/android/com/google/firebase/ai/type/Schema.html">Schema</a></code> representing a value that must conform to <em>any</em> (one of) the provided sub-schema.</p>
<p>Example: A field that can hold either a simple userID or a more detailed user object.</p>
- <p>Schema.anyOf( listOf( Schema.integer(description = "User ID"), Schema.obj(mapOf(</p>
- <pre class="prettyprint"> "userID" to Schema.integer(description = "User ID"),<br> "username" to Schema.string(description = "Username")</pre>
- <p>)) )</p>
+ <pre class="prettyprint">Schema.anyOf( listOf( Schema.integer(description = "User ID"), Schema.obj( mapOf(<br> "userID" to Schema.integer(description = "User ID"),<br> "username" to Schema.string(description = "Username")<br>)))</pre>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup> --- /home/runner/diff/original/firebase-kotlindoc/kotlin/com/google/firebase/ai/type/Schema.html 2025-06-23 13:24:29.677299165 +0000
+++ /home/runner/diff/modified/firebase-kotlindoc/kotlin/com/google/firebase/ai/type/Schema.html 2025-06-23 13:20:58.524987100 +0000
@@ -206,9 +206,7 @@
<pre class="api-signature no-pretty-print">fun <a href="/docs/reference/kotlin/com/google/firebase/ai/type/Schema.Companion.html#anyOf(kotlin.collections.List)">anyOf</a>(schemas: <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html">List</a><<a href="/docs/reference/kotlin/com/google/firebase/ai/type/Schema.html">Schema</a>>): <a href="/docs/reference/kotlin/com/google/firebase/ai/type/Schema.html">Schema</a></pre>
<p>Returns a <code><a href="/docs/reference/kotlin/com/google/firebase/ai/type/Schema.html">Schema</a></code> representing a value that must conform to <em>any</em> (one of) the provided sub-schema.</p>
<p>Example: A field that can hold either a simple userID or a more detailed user object.</p>
- <p>Schema.anyOf( listOf( Schema.integer(description = "User ID"), Schema.obj(mapOf(</p>
- <pre class="prettyprint"> "userID" to Schema.integer(description = "User ID"),<br> "username" to Schema.string(description = "Username")</pre>
- <p>)) )</p>
+ <pre class="prettyprint">Schema.anyOf( listOf( Schema.integer(description = "User ID"), Schema.obj( mapOf(<br> "userID" to Schema.integer(description = "User ID"),<br> "username" to Schema.string(description = "Username")<br>)))</pre>
<div class="devsite-table-wrapper">
<table class="responsive">
<colgroup> |
Generated by 🚫 Danger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request addresses an issue where the sample code in the anyOf
refdoc was not correctly enclosed in backticks, leading to incorrect rendering. The provided code suggestion aims to improve the readability of the code example by formatting it according to Kotlin conventions.
Test Results 24 files - 20 24 suites - 20 34s ⏱️ - 5m 45s Results for commit c6aae10. ± Comparison against base commit 43491db. This pull request removes 136 and adds 102 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Size Report 1Affected Products
Test Logs |
The sample code was not correctly enclosed in backticks (`), causing the code to be incorrectly rendered.