Skip to content

Docs: update with rfl::Deprecated#625

Open
AndrewNolte wants to merge 3 commits intogetml:mainfrom
AndrewNolte:json-schema-deprecated-docs
Open

Docs: update with rfl::Deprecated#625
AndrewNolte wants to merge 3 commits intogetml:mainfrom
AndrewNolte:json-schema-deprecated-docs

Conversation

@AndrewNolte
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 enhances the project's documentation by introducing and explaining the rfl::Deprecated utility. It provides clear guidance on how to mark fields as deprecated within JSON schemas, ensuring that users can effectively manage evolving data structures and communicate deprecation messages.

Highlights

  • rfl::Deprecated Example: An example demonstrating the use of rfl::Deprecated has been added to the Person struct in README.md to show how to mark fields as deprecated.
  • rfl::Deprecated Documentation: Comprehensive documentation for rfl::Deprecated has been added to docs/json_schema.md, explaining its purpose, template parameters, and how it affects the generated JSON schema.
Changelog
  • README.md
    • Added an example of rfl::Deprecated to the Person struct.
  • docs/json_schema.md
    • Introduced a new section "Indicating deprecated fields".
    • Explained the rfl::Deprecated template parameters and its effect on JSON schema output.
    • Provided a C++ code example and its corresponding JSON schema output.
    • Described how rfl::Deprecated behaves as a wrapper.
Activity
  • No human activity has been recorded on this pull request yet.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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

  1. 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.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation to include the new rfl::Deprecated feature. The changes are a good addition, but I've found a couple of areas for improvement. In README.md, an example was updated, but the corresponding JSON schema was not, leading to an inconsistency. In docs/json_schema.md, the example for rfl::Deprecated shows a deprecated field as required, which is an uncommon pattern. I've suggested making the deprecated field optional and updating the schema to reflect a more realistic use case.

README.md Outdated
std::vector<Person>>
children;
float salary;
rfl::Deprecated<"Use Salary Instead", "Wage in dollars", int> wage;

Choose a reason for hiding this comment

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

medium

With the addition of the wage field, the JSON schema example shown below is now out of date. Please update it to include the new wage field, which should be marked as deprecated in the schema.

The updated schema should look like this:

{"$schema":"https://json-schema.org/draft/2020-12/schema","$ref":"#/$defs/Person","$defs":{"Person":{"type":"object","properties":{"children":{"type":"array","description":"The person's children. Pass an empty array for no children.","items":{"$ref":"#/$defs/Person"}},"email":{"type":"string","description":"Must be a proper email in the form xxx@xxx.xxx.","pattern":"^[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}$"},"first_name":{"type":"string"},"last_name":{"type":"string"},"salary":{"type":"number"},"wage":{"type":"integer","description":"Wage in dollars","deprecated":true,"deprecationMessage":"Use Salary Instead"}},"required":["children","email","first_name","last_name","salary","wage"]}}}

Comment on lines +223 to +241
"first_name": {
"type": "string",
"description": "The person's first name",
"deprecated": true,
"deprecationMessage": "Use 'full_name' instead."
},
"full_name": {
"type": "string",
"description": "The person's full name"
},
"salary": {
"type": "number"
}
},
"required": [
"first_name",
"full_name",
"salary"
]

Choose a reason for hiding this comment

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

medium

Following the suggestion to make first_name optional, the JSON schema should be updated. The first_name property should allow null values, and it should be removed from the required array.

                "first_name": {
                    "description": "The person's first name",
                    "deprecated": true,
                    "deprecationMessage": "Use 'full_name' instead.",
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "full_name": {
                    "type": "string",
                    "description": "The person's full name"
                },
                "salary": {
                    "type": "number"
                }
            },
            "required": [
                "full_name",
                "salary"
            ]

AndrewNolte and others added 2 commits March 2, 2026 16:42
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant