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

feat(common): Add utoipa attribute macro types #2000

Merged
merged 3 commits into from
Mar 12, 2025
Merged

Conversation

fussybeaver
Copy link
Contributor

Description of change

This is a re-opening of #1924 for internal API testing needs.

How has this been tested? (if applicable)

This is being used to create API tests for the backend API platform.

@fussybeaver fussybeaver marked this pull request as ready for review March 11, 2025 12:05
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added OpenAPI schema generation capabilities across the common module by implementing utoipa attribute macros for data structures.

  • Added utoipa crate as an optional dependency in common/Cargo.toml with chrono feature enabled
  • Added #[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))] to key data structures in models and secrets modules
  • Missing utoipa attribute on DeleteCertificateRequest struct in certificate.rs should be added for consistency

Note: This review focuses on the most recent changes and does not repeat points from previous reviews.

6 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This PR updates the Secret type implementation to include OpenAPI schema generation support and consolidates utoipa dependency management at the workspace level.

  • Added #[schema(value_type = String, format = Password)] to Secret struct in common/src/secrets.rs for proper OpenAPI documentation
  • Moved utoipa dependency from direct version to workspace-managed version in common/Cargo.toml
  • Added utoipa feature flag in common/Cargo.toml to make the OpenAPI schema generation optional

The changes look focused and well-structured, maintaining the security aspects of the Secret type while adding API documentation capabilities.

3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

@fussybeaver fussybeaver merged commit 48f201e into main Mar 12, 2025
21 checks passed
@jonaro00 jonaro00 deleted the ND/utoipa-next branch March 12, 2025 11:01
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.

None yet

3 participants