File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1414from flask_rebar .validation import filter_dump_only , RequireOnDumpMixin
1515
1616
17+ # Marshmallow version detection for backward compatibility
18+ MARSHMALLOW_VERSION_MAJOR = int (version ("marshmallow" ).split ("." )[0 ])
19+
20+
1721def set_data_key (field : Field , key : str ) -> Field :
1822 field .data_key = key
1923 return field
@@ -71,10 +75,6 @@ def exclude_unknown_fields(schema: Schema) -> Schema:
7175 return schema
7276
7377
74- # Marshmallow version detection for backward compatibility
75- MARSHMALLOW_VERSION_MAJOR = int (version ("marshmallow" ).split ("." )[0 ])
76-
77-
7878def is_schema_ordered (schema : Schema ) -> bool :
7979 """
8080 Check if a schema should maintain field order.
@@ -89,6 +89,6 @@ def is_schema_ordered(schema: Schema) -> bool:
8989 if MARSHMALLOW_VERSION_MAJOR >= 4 :
9090 # In Marshmallow 4+, fields are always ordered (insertion order)
9191 return True
92- else :
93- # In Marshmallow 3, check the 'ordered' attribute
94- return getattr (schema , "ordered" , False )
92+
93+ # In Marshmallow 3, check the 'ordered' attribute
94+ return getattr (schema , "ordered" , False )
You can’t perform that action at this time.
0 commit comments