@@ -102,7 +102,7 @@ export function SMBForm(props: SMBFormProps) {
102102 setFunctionModel ( initialFunction ) ;
103103 setSelectedFileFormat ( initialFunction . name ?. metadata ?. label || '' ) ;
104104 }
105- } , [ selectedHandler ] ) ;
105+ } , [ selectedHandler , isNew ] ) ;
106106
107107 const handleParamChange = ( params : ParameterModel [ ] ) => {
108108 if ( functionModel ) {
@@ -149,7 +149,7 @@ export function SMBForm(props: SMBFormProps) {
149149
150150 if ( selectedFileFormat === 'RAW' ) {
151151 if ( isStreamEnabled ) {
152- return `stream<byte[], error>` ;
152+ return `stream<byte[], error? >` ;
153153 } else {
154154 return `byte[]` ;
155155 }
@@ -158,15 +158,17 @@ export function SMBForm(props: SMBFormProps) {
158158 if ( baseType . endsWith ( "[]" ) && baseType !== "string[]" ) {
159159 baseType = baseType . slice ( 0 , - 2 ) ;
160160 } else if ( baseType . startsWith ( "stream<" ) ) {
161- if ( baseType . endsWith ( ", error>" ) ) {
161+ if ( baseType . endsWith ( ", error?>" ) ) {
162+ baseType = baseType . slice ( 7 , - 9 ) ;
163+ } else if ( baseType . endsWith ( ", error>" ) ) {
162164 baseType = baseType . slice ( 7 , - 8 ) ;
163165 } else if ( baseType . endsWith ( ">" ) ) {
164166 baseType = baseType . slice ( 7 , - 1 ) ;
165167 }
166168 }
167169
168170 if ( isStreamEnabled ) {
169- return `stream<${ baseType } , error>` ;
171+ return `stream<${ baseType } , error? >` ;
170172 } else {
171173 return `${ baseType } []` ;
172174 }
@@ -183,7 +185,9 @@ export function SMBForm(props: SMBFormProps) {
183185 let baseType = typeValue ;
184186
185187 if ( baseType . startsWith ( "stream<" ) ) {
186- if ( baseType . endsWith ( ", error>" ) ) {
188+ if ( baseType . endsWith ( ", error?>" ) ) {
189+ baseType = baseType . slice ( 7 , - 9 ) ;
190+ } else if ( baseType . endsWith ( ", error>" ) ) {
187191 baseType = baseType . slice ( 7 , - 8 ) ;
188192 } else if ( baseType . endsWith ( ">" ) ) {
189193 baseType = baseType . slice ( 7 , - 1 ) ;
0 commit comments