File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
customizations/generator/openapi/src/main/resources/post-processor/src Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ import {NonCancellableDateTimeRangeProcessor} from './processors/non-cancellable
55import { PenaltyRuleProcessor } from './processors/penalty-rule-processor' ;
66import { VendorLocationDetailsProcessor } from './processors/vendor-location-details-processor' ;
77import { GetCarsListingsOperationParamsProcessor } from './processors/get-cars-listings-operation-params-processor' ;
8- import { ActivitiesCancellationPolicyProcessor } from "./processors/activities-cancellation-policy-processor" ;
8+ import { ActivitiesCancellationPolicyProcessor } from './processors/activities-cancellation-policy-processor' ;
9+ import { AvailableTimeSlotProcessor } from "./processors/available-time-slot-processor" ;
910
1011import * as path from 'path' ;
1112
@@ -38,4 +39,7 @@ switch (fileName) {
3839 case 'ActivitiesCancellationPolicy' :
3940 new ActivitiesCancellationPolicyProcessor ( ) . process ( filePath ) ;
4041 break ;
42+ case 'AvailableTimeSlot' :
43+ new AvailableTimeSlotProcessor ( ) . process ( filePath ) ;
44+ break ;
4145}
Original file line number Diff line number Diff line change 1+ import { Edit , NapiConfig , SgNode } from '@ast-grep/napi' ;
2+ import { Processor } from './processor' ;
3+ import { RuleFunction } from './shared.types' ;
4+
5+ export class AvailableTimeSlotProcessor extends Processor {
6+ rules : RuleFunction [ ] ;
7+ id : String = 'available-time-slot-processor' ;
8+
9+ constructor ( ) {
10+ super ( ) ;
11+ this . rules = [
12+ this . changeClassParamType ,
13+ this . changeBuilderMethodParamType ,
14+ ] . map ( rule => rule . bind ( this ) ) ;
15+ }
16+
17+ changeClassParamType ( root : SgNode ) : Edit [ ] {
18+ const config = this . readRule ( 'change-class-param-type' ) ;
19+
20+ return root . findAll ( config ) . map ( node => {
21+ return node . replace ( 'java.time.LocalDateTime' ) ;
22+ } ) ;
23+ }
24+
25+ changeBuilderMethodParamType ( root : SgNode ) : Edit [ ] {
26+ const config = this . readRule ( 'change-builder-method-param-type' ) ;
27+
28+ return root . findAll ( config ) . map ( node => {
29+ return node . replace ( 'java.time.LocalDateTime' ) ;
30+ } ) ;
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments