File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
crates/stackable-versioned-macros/src/codegen Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -432,7 +432,7 @@ impl Struct {
432432 for object in objects {
433433 // This clone is required because in the noop case we move the object into
434434 // the converted objects vec.
435- let current_object = Self :: from_json_value ( object. clone( ) )
435+ let current_object = Self :: from_json_object ( object. clone( ) )
436436 . map_err( |source| #convert_object_error:: Parse { source } ) ?;
437437
438438 match ( current_object, desired_api_version) {
@@ -513,7 +513,7 @@ impl Struct {
513513 } )
514514 }
515515
516- pub ( super ) fn generate_from_json_value_fn (
516+ pub ( super ) fn generate_from_json_object_fn (
517517 & self ,
518518 mod_gen_ctx : ModuleGenerationContext < ' _ > ,
519519 spec_gen_ctx : & SpecGenerationContext < ' _ > ,
@@ -540,7 +540,7 @@ impl Struct {
540540 } ) ;
541541
542542 Some ( quote ! {
543- fn from_json_value ( object_value: #serde_json_path:: Value ) -> :: std:: result:: Result <Self , #parse_object_error> {
543+ fn from_json_object ( object_value: #serde_json_path:: Value ) -> :: std:: result:: Result <Self , #parse_object_error> {
544544 let kind = object_value
545545 . get( "kind" )
546546 . ok_or_else( || #parse_object_error:: FieldNotPresent {
Original file line number Diff line number Diff line change @@ -318,7 +318,7 @@ impl Struct {
318318
319319 let merged_crd_fn = self . generate_merged_crd_fn ( mod_gen_ctx, spec_gen_ctx) ;
320320 let try_convert_fn = self . generate_try_convert_fn ( versions, mod_gen_ctx, spec_gen_ctx) ;
321- let from_json_value_fn = self . generate_from_json_value_fn ( mod_gen_ctx, spec_gen_ctx) ;
321+ let from_json_object_fn = self . generate_from_json_object_fn ( mod_gen_ctx, spec_gen_ctx) ;
322322 let into_json_value_fn = self . generate_into_json_value_fn ( mod_gen_ctx, spec_gen_ctx) ;
323323
324324 let automatically_derived = mod_gen_ctx. automatically_derived_attr ( ) ;
@@ -328,7 +328,7 @@ impl Struct {
328328 impl #enum_ident {
329329 #merged_crd_fn
330330 #try_convert_fn
331- #from_json_value_fn
331+ #from_json_object_fn
332332 #into_json_value_fn
333333 }
334334 }
Original file line number Diff line number Diff line change @@ -137,7 +137,6 @@ impl Module {
137137 }
138138
139139 let preserve_module = self . options . common . preserve_module . is_present ( ) ;
140- let allow_unsorted = self . options . common . allow_unsorted . is_present ( ) ;
141140
142141 let module_ident = & self . ident ;
143142 let module_vis = & self . vis ;
@@ -146,7 +145,7 @@ impl Module {
146145 // of version modules (eg. 'v1alpha1') to be public, so that they are accessible inside the
147146 // preserved (wrapping) module. Otherwise, we can inherit the visibility from the module
148147 // which will be erased.
149- let version_module_vis = if allow_unsorted {
148+ let version_module_vis = if preserve_module {
150149 & Visibility :: Public ( Pub :: default ( ) )
151150 } else {
152151 & self . vis
You can’t perform that action at this time.
0 commit comments