feat(schemas): add MeshModel component and relationship summary filter schemas#752
feat(schemas): add MeshModel component and relationship summary filter schemas#752Junnygram wants to merge 2 commits intomeshery:masterfrom
Conversation
…r schemas Signed-off-by: Junnygram <junnexclusive@gmail.com>
There was a problem hiding this comment.
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.
| annotations: | ||
| type: string | ||
| description: "Filter by annotations." | ||
| enum: ["true", "false"] |
There was a problem hiding this comment.
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
- Schemas within the meshery/schemas repository should maintain a uniform pattern across all constructs.
- 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"] |
There was a problem hiding this comment.
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
- OpenAPI schema properties for payloads must exactly match the json tags of the corresponding server-side structs.
- Field name casing in generated structs must match the casing in the source of truth, even if this leads to inconsistencies across different structs.
- 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"] |
There was a problem hiding this comment.
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
- OpenAPI schema properties for payloads must exactly match the json tags of the corresponding server-side structs.
- Field name casing in generated structs must match the casing in the source of truth.
- When updating an API endpoint, ensure that corresponding endpoints in other API versions are updated consistently.
Signed-off-by: Junnygram <junnexclusive@gmail.com>
This PR introduces OpenAPI schemas for MeshModel component and relationship summary filters.
Fixes define openapi schemas for meshmodel component and relationship summary filters #747