Skip to content

feat(schemas): add MeshModel component and relationship summary filter schemas#752

Open
Junnygram wants to merge 2 commits intomeshery:masterfrom
Junnygram:add-meshmodel-filter-schemas
Open

feat(schemas): add MeshModel component and relationship summary filter schemas#752
Junnygram wants to merge 2 commits intomeshery:masterfrom
Junnygram:add-meshmodel-filter-schemas

Conversation

@Junnygram
Copy link
Copy Markdown

This PR introduces OpenAPI schemas for MeshModel component and relationship summary filters.

…r schemas

Signed-off-by: Junnygram <junnexclusive@gmail.com>
Copy link
Copy Markdown
Contributor

@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 introduces new schemas for component and relationship summaries and filters in the v1beta2 API. The review feedback recommends defining the "annotations" filter as a boolean type for consistency and updating the "include" enum values from snake_case to camelCase to align with the summary object properties and server-side JSON tags.

Comment on lines +110 to +113
annotations:
type: string
description: "Filter by annotations."
enum: ["true", "false"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The annotations filter is defined as a string enum with values "true" and "false". To maintain consistency with other boolean filters in this schema (such as greedy in RelationshipSummaryFilter) and to follow standard OpenAPI practices, this should be defined as type: boolean. Additionally, ensure that corresponding endpoints in other API versions (like v1beta1) are updated consistently.

        annotations:
          type: boolean
          description: "Filter by annotations."
References
  1. Schemas within the meshery/schemas repository should maintain a uniform pattern across all constructs.
  2. When updating an API endpoint, ensure that corresponding endpoints in other API versions (e.g., v1beta1 and v1beta2) are updated consistently to match exactly.

type: array
items:
type: string
enum: ["by_model", "by_category", "by_registrant"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The enum values for the include array use snake_case, while the corresponding properties in the ComponentSummary object use camelCase. OpenAPI schema properties for payloads must exactly match the json tags of the corresponding server-side structs to prevent silent field dropping. If the server implementation uses camelCase, these enum values should be updated to match. Ensure this is applied consistently across API versions.

            enum: ["byModel", "byCategory", "byRegistrant"]
References
  1. OpenAPI schema properties for payloads must exactly match the json tags of the corresponding server-side structs.
  2. Field name casing in generated structs must match the casing in the source of truth, even if this leads to inconsistencies across different structs.
  3. When updating an API endpoint, ensure that corresponding endpoints in other API versions are updated consistently.

type: array
items:
type: string
enum: ["by_model", "by_kind", "by_type", "by_subtype"]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The enum values for the include array use snake_case, whereas the RelationshipSummary object uses camelCase. Casing in the schema must match the server-side source of truth (json tags). Using camelCase for these enum values would improve consistency across the API definition and match the server implementation. Ensure other API versions are updated to match.

            enum: ["byModel", "byKind", "byType", "bySubType"]
References
  1. OpenAPI schema properties for payloads must exactly match the json tags of the corresponding server-side structs.
  2. Field name casing in generated structs must match the casing in the source of truth.
  3. When updating an API endpoint, ensure that corresponding endpoints in other API versions are updated consistently.

Signed-off-by: Junnygram <junnexclusive@gmail.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.

define openapi schemas for meshmodel component and relationship summary filters

1 participant