@@ -567,11 +567,18 @@ export class ODataV4Plugin implements RuntimePlugin {
567567 * Expand navigation properties for OData $expand
568568 *
569569 * Implements OData V4 $expand feature to include related entities in the response.
570- * Supports:
571- * - Single property expand: $expand=owner
572- * - Multiple properties: $expand=owner,department
573- * - Nested expand: $expand=owner($expand=department)
574- * - Expand with options: $expand=orders($filter=status eq 'active')
570+ *
571+ * **Current Support**:
572+ * - ✅ Single property expand: $expand=owner
573+ * - ✅ Multiple properties: $expand=owner,department
574+ * - ✅ Expand with options: $expand=orders($filter=status eq 'active')
575+ * - ✅ Supported options: $filter, $select, $orderby, $top
576+ *
577+ * **Limitations** (Phase 2 roadmap):
578+ * - ⚠️ Nested expand not yet supported: $expand=owner($expand=department)
579+ * - ⚠️ Only single-level relationship expansion
580+ *
581+ * See PROTOCOL_DEVELOPMENT_PLAN_ZH.md Phase 2 for nested expand implementation.
575582 *
576583 * @param entitySet - The main entity set name
577584 * @param entities - Array of entities to expand properties for
@@ -589,16 +596,19 @@ export class ODataV4Plugin implements RuntimePlugin {
589596 }
590597
591598 // Parse the expand parameter (simple implementation - handles comma-separated properties)
592- // TODO: In future, support nested expands with parentheses: owner($expand=department)
599+ // Note: Nested expands (e.g., owner($expand=department)) are not yet supported
600+ // and will be rejected by the regex pattern below
593601 const expandProperties = expandParam . split ( ',' ) . map ( p => p . trim ( ) ) ;
594602
595603 // For each expand property, fetch related data
596604 for ( const propertyName of expandProperties ) {
597605 // Parse property name and options (basic implementation)
598606 // Format: propertyName or propertyName($filter=...$select=...)
607+ // Nested expands with multiple levels are NOT supported in this version
599608 const propMatch = propertyName . match ( / ^ ( \w + ) (?: \( ( [ ^ ) ] + ) \) ) ? $ / ) ;
600609 if ( ! propMatch ) {
601- continue ; // Skip invalid property syntax
610+ // Invalid syntax or nested expand detected - skip
611+ continue ;
602612 }
603613
604614 const [ , fieldName , options ] = propMatch ;
0 commit comments