@@ -32,6 +32,21 @@ interface GetOutput {
3232 * Use --expand-all to get the full, unmodified schema.
3333 */
3434export default class ScapiSchemasGet extends ScapiSchemasCommand < typeof ScapiSchemasGet > {
35+ static args = {
36+ apiFamily : Args . string ( {
37+ description : t ( 'args.apiFamily.description' , 'API family (e.g., shopper, admin)' ) ,
38+ required : true ,
39+ } ) ,
40+ apiName : Args . string ( {
41+ description : t ( 'args.apiName.description' , 'API name (e.g., products, orders)' ) ,
42+ required : true ,
43+ } ) ,
44+ apiVersion : Args . string ( {
45+ description : t ( 'args.apiVersion.description' , 'API version (e.g., v1)' ) ,
46+ required : true ,
47+ } ) ,
48+ } ;
49+
3550 static description = t (
3651 'commands.scapi.schemas.get.description' ,
3752 'Get a specific SCAPI schema with optional selective expansion' ,
@@ -56,21 +71,6 @@ export default class ScapiSchemasGet extends ScapiSchemasCommand<typeof ScapiSch
5671 '<%= config.bin %> <%= command.id %> shopper products v1 --tenant-id f_ecom_zzxy_prd --json' ,
5772 ] ;
5873
59- static args = {
60- apiFamily : Args . string ( {
61- description : t ( 'args.apiFamily.description' , 'API family (e.g., shopper, admin)' ) ,
62- required : true ,
63- } ) ,
64- apiName : Args . string ( {
65- description : t ( 'args.apiName.description' , 'API name (e.g., products, orders)' ) ,
66- required : true ,
67- } ) ,
68- apiVersion : Args . string ( {
69- description : t ( 'args.apiVersion.description' , 'API version (e.g., v1)' ) ,
70- required : true ,
71- } ) ,
72- } ;
73-
7474 static flags = {
7575 ...ScapiSchemasCommand . baseFlags ,
7676
@@ -127,7 +127,7 @@ export default class ScapiSchemasGet extends ScapiSchemasCommand<typeof ScapiSch
127127 } ) ,
128128 } ;
129129
130- async run ( ) : Promise < GetOutput | string [ ] | null > {
130+ async run ( ) : Promise < GetOutput | null | string [ ] > {
131131 this . requireOAuthCredentials ( ) ;
132132
133133 const { apiFamily, apiName, apiVersion} = this . args ;
@@ -364,7 +364,7 @@ export default class ScapiSchemasGet extends ScapiSchemasCommand<typeof ScapiSch
364364 for ( const line of valueLines ) {
365365 lines . push ( `${ indentStr } ${ line } ` ) ;
366366 }
367- } else if ( Array . isArray ( value ) && value . length > 0 && value . some ( ( item ) => typeof item === 'object' ) ) {
367+ } else if ( Array . isArray ( value ) && value . some ( ( item ) => typeof item === 'object' ) ) {
368368 // Array with objects - put on next line
369369 lines . push ( `${ indentStr } ${ key } :` ) ;
370370 const valueLines = serializedValue . split ( '\n' ) ;
0 commit comments