@@ -12,6 +12,7 @@ export type OperationTemplate = {
1212 searchParams : OperationParameter [ ] ,
1313 hasFormData : boolean ,
1414 responses : string [ ] ,
15+ isCacheable : boolean ,
1516} ;
1617
1718function quotePathName ( pathName : string , parameters : OperationParameter [ ] ) {
@@ -24,14 +25,15 @@ function getSearchParams(parameters: OperationParameter[]) {
2425 return parameters . filter ( param => param . in === "query" ) ;
2526}
2627
27- export default function resolveOperations ( paths : OpenAPI [ "paths" ] ) {
28+ export default function resolveOperations ( paths : OpenAPI [ "paths" ] , framework : string | null ) {
2829 return resolveEndpoints ( paths ) . map < OperationTemplate > ( ( { method, path, operation } ) => ( {
2930 name : operation . operationId ,
3031 method : method . toUpperCase ( ) ,
3132 path : quotePathName ( path , operation . parameters ?? [ ] ) ,
32- parameters : resolveOperationParams ( operation , false ) . join ( ", " ) ,
33+ parameters : resolveOperationParams ( operation , method , false , framework ) . join ( ", " ) ,
3334 searchParams : getSearchParams ( operation . parameters ?? [ ] ) ,
3435 hasFormData : hasFormData ( operation ) ,
3536 responses : resolveResponses ( operation . responses ) ,
37+ isCacheable : framework === "next" && method . toUpperCase ( ) === "GET" ,
3638 } ) ) ;
3739}
0 commit comments