mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-30 00:21:34 +00:00
Add missing nullable annotations, search_field schema documentation (#10092)
* Add search_fields list to schema documentation * Add missing nullable annotations * Bump api version
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
"""InvenTree API version information."""
|
||||
|
||||
# InvenTree API version
|
||||
INVENTREE_API_VERSION = 373
|
||||
INVENTREE_API_VERSION = 374
|
||||
|
||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||
|
||||
INVENTREE_API_TEXT = """
|
||||
v374 -> 2025-07-28 : https://github.com/inventree/InvenTree/pull/10092
|
||||
- Add nullable to a few details fields that lack it
|
||||
- Add the list of searched fields to the search parameter comments
|
||||
|
||||
v373 -> 2025-06-21 : https://github.com/inventree/InvenTree/pull/9735
|
||||
- Adds PluginUserSetting model (and associated endpoints)
|
||||
- Remove NotificationSetting model (and associated endpoints)
|
||||
|
@@ -103,6 +103,16 @@ class ExtendedAutoSchema(AutoSchema):
|
||||
f'{parameter["description"]} Possible fields: {", ".join(ordering_fields)}.'
|
||||
)
|
||||
|
||||
# Add valid search fields to the search description.
|
||||
search_fields = getattr(self.view, 'search_fields', None)
|
||||
if search_fields is not None:
|
||||
parameters = operation.get('parameters', [])
|
||||
for parameter in parameters:
|
||||
if parameter['name'] == 'search':
|
||||
parameter['description'] = (
|
||||
f'{parameter["description"]} Searched fields: {", ".join(search_fields)}.'
|
||||
)
|
||||
|
||||
return operation
|
||||
|
||||
|
||||
|
@@ -1417,6 +1417,7 @@ class BuildLineSerializer(DataImportExportSerializerMixin, InvenTreeModelSeriali
|
||||
source='bom_item.part',
|
||||
many=False,
|
||||
read_only=True,
|
||||
allow_null=True,
|
||||
pricing=False,
|
||||
)
|
||||
|
||||
|
@@ -1447,7 +1447,11 @@ class SalesOrderAllocationSerializer(InvenTreeModelSerializer):
|
||||
)
|
||||
|
||||
shipment_detail = SalesOrderShipmentSerializer(
|
||||
source='shipment', order_detail=False, many=False, read_only=True
|
||||
source='shipment',
|
||||
order_detail=False,
|
||||
many=False,
|
||||
read_only=True,
|
||||
allow_null=True,
|
||||
)
|
||||
|
||||
|
||||
|
@@ -456,7 +456,9 @@ class PartParameterSerializer(
|
||||
source='template', many=False, read_only=True, allow_null=True
|
||||
)
|
||||
|
||||
updated_by_detail = UserSerializer(source='updated_by', many=False, read_only=True)
|
||||
updated_by_detail = UserSerializer(
|
||||
source='updated_by', many=False, read_only=True, allow_null=True
|
||||
)
|
||||
|
||||
|
||||
class DuplicatePartSerializer(serializers.Serializer):
|
||||
|
Reference in New Issue
Block a user