@@ -751,33 +751,6 @@ private void patchPropertyVendorExtensions(CodegenProperty property) {
751751 protected void patchPropertyIsInherited (CodegenModel model , CodegenProperty property ) {
752752 }
753753
754- protected void patchProperty (Map <String , CodegenModel > enumRefs , CodegenModel model , CodegenProperty property ) {
755- if (enumRefs .containsKey (property .dataType )) {
756- // Handle any enum properties referred to by $ref.
757- // This is different in C# than most other generators, because enums in C# are compiled to integral types,
758- // while enums in many other languages are true objects.
759- CodegenModel refModel = enumRefs .get (property .dataType );
760- property .allowableValues = refModel .allowableValues ;
761- property .isEnum = true ;
762-
763- // We do these after updateCodegenPropertyEnum to avoid generalities that don't mesh with C#.
764- property .isPrimitiveType = true ;
765- }
766-
767- this .patchPropertyIsInherited (model , property );
768-
769- patchPropertyVendorExtensions (property );
770-
771- property .name = patchPropertyName (model , property .name , null );
772-
773- patchNestedMaps (property );
774-
775- // HOTFIX: https://github.com/OpenAPITools/openapi-generator/issues/14944
776- if (property .datatypeWithEnum .equals ("decimal" )) {
777- property .isDecimal = true ;
778- }
779- }
780-
781754 private void patchNestedMaps (CodegenProperty property ) {
782755 // Process nested types before making any replacements to ensure we have the correct inner type
783756 if (property .items != null ) {
@@ -809,6 +782,33 @@ private void patchNestedMaps(CodegenProperty property) {
809782 }
810783 }
811784
785+ protected void patchProperty (Map <String , CodegenModel > enumRefs , CodegenModel model , CodegenProperty property ) {
786+ if (enumRefs .containsKey (property .dataType )) {
787+ // Handle any enum properties referred to by $ref.
788+ // This is different in C# than most other generators, because enums in C# are compiled to integral types,
789+ // while enums in many other languages are true objects.
790+ CodegenModel refModel = enumRefs .get (property .dataType );
791+ property .allowableValues = refModel .allowableValues ;
792+ property .isEnum = true ;
793+
794+ // We do these after updateCodegenPropertyEnum to avoid generalities that don't mesh with C#.
795+ property .isPrimitiveType = true ;
796+ }
797+
798+ this .patchPropertyIsInherited (model , property );
799+
800+ patchPropertyVendorExtensions (property );
801+
802+ property .name = patchPropertyName (model , property .name , null );
803+
804+ patchNestedMaps (property );
805+
806+ // HOTFIX: https://github.com/OpenAPITools/openapi-generator/issues/14944
807+ if (property .datatypeWithEnum .equals ("decimal" )) {
808+ property .isDecimal = true ;
809+ }
810+ }
811+
812812 @ Override
813813 protected List <Map <String , Object >> buildEnumVars (List <Object > values , String dataType ) {
814814 List <Map <String , Object >> enumVars = super .buildEnumVars (values , dataType );
0 commit comments