@@ -61,7 +61,8 @@ public class RustAxumServerCodegen extends AbstractRustCodegen implements Codege
6161 private Boolean allowBlockingValidator = false ;
6262 private Boolean allowBlockingResponseSerialize = false ;
6363 private String externCrateName ;
64- private Boolean havingAuthorization = false ;
64+ private Boolean basicAuthorization = false ;
65+ private Boolean basicAnalytic = false ;
6566
6667 // Types
6768 private static final String uuidType = "uuid::Uuid" ;
@@ -227,11 +228,6 @@ public RustAxumServerCodegen() {
227228 optAllowBlockingResponseSerialize .setType ("bool" );
228229 optAllowBlockingResponseSerialize .defaultValue (allowBlockingResponseSerialize .toString ());
229230
230- CliOption optHavingAuthorization = new CliOption ("havingAuthorization" ,
231- String .join ("" , "Set this option to true will generate authorization handle for all authenticated operations." ));
232- optHavingAuthorization .setType ("bool" );
233- optHavingAuthorization .defaultValue (havingAuthorization .toString ());
234-
235231 cliOptions = new ArrayList <>(
236232 List .of (
237233 new CliOption (CodegenConstants .PACKAGE_NAME ,
@@ -241,8 +237,7 @@ public RustAxumServerCodegen() {
241237 "Rust crate version." ),
242238 optDisableValidator ,
243239 optAllowBlockingValidator ,
244- optAllowBlockingResponseSerialize ,
245- optHavingAuthorization
240+ optAllowBlockingResponseSerialize
246241 )
247242 );
248243
@@ -324,10 +319,16 @@ public void processOpts() {
324319 additionalProperties .put ("allowBlockingResponseSerialize" , allowBlockingResponseSerialize );
325320 }
326321
327- if (additionalProperties .containsKey ("havingAuthorization" )) {
328- havingAuthorization = convertPropertyToBooleanAndWriteBack ("havingAuthorization" );
322+ if (additionalProperties .containsKey ("basicAuthorization" )) {
323+ basicAuthorization = convertPropertyToBooleanAndWriteBack ("basicAuthorization" );
324+ } else {
325+ additionalProperties .put ("basicAuthorization" , basicAuthorization );
326+ }
327+
328+ if (additionalProperties .containsKey ("basicAnalytic" )) {
329+ basicAnalytic = convertPropertyToBooleanAndWriteBack ("basicAnalytic" );
329330 } else {
330- additionalProperties .put ("havingAuthorization " , havingAuthorization );
331+ additionalProperties .put ("basicAnalytic " , basicAnalytic );
331332 }
332333 }
333334
@@ -736,12 +737,17 @@ public OperationsMap postProcessOperationsWithModels(final OperationsMap operati
736737 operations .getOperation ().forEach (op -> op .vendorExtensions .put ("havingAuthMethod" , true ));
737738 this .havingAuthMethods = true ;
738739
739- if (havingAuthorization ) {
740- operations .put ("havingAuthorization " , true );
741- operations .getOperation ().forEach (op -> op .vendorExtensions .put ("havingAuthorization " , true ));
740+ if (basicAuthorization ) {
741+ operations .put ("basicAuthorization " , true );
742+ operations .getOperation ().forEach (op -> op .vendorExtensions .put ("basicAuthorization " , true ));
742743 }
743744 }
744745
746+ if (basicAnalytic ) {
747+ operations .put ("basicAnalytic" , true );
748+ operations .getOperation ().forEach (op -> op .vendorExtensions .put ("basicAnalytic" , true ));
749+ }
750+
745751 return operationsMap ;
746752 }
747753
0 commit comments