mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-30 16:41:35 +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 information."""
|
||||||
|
|
||||||
# InvenTree API version
|
# 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."""
|
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||||
|
|
||||||
INVENTREE_API_TEXT = """
|
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
|
v373 -> 2025-06-21 : https://github.com/inventree/InvenTree/pull/9735
|
||||||
- Adds PluginUserSetting model (and associated endpoints)
|
- Adds PluginUserSetting model (and associated endpoints)
|
||||||
- Remove NotificationSetting 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)}.'
|
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
|
return operation
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1417,6 +1417,7 @@ class BuildLineSerializer(DataImportExportSerializerMixin, InvenTreeModelSeriali
|
|||||||
source='bom_item.part',
|
source='bom_item.part',
|
||||||
many=False,
|
many=False,
|
||||||
read_only=True,
|
read_only=True,
|
||||||
|
allow_null=True,
|
||||||
pricing=False,
|
pricing=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -1447,7 +1447,11 @@ class SalesOrderAllocationSerializer(InvenTreeModelSerializer):
|
|||||||
)
|
)
|
||||||
|
|
||||||
shipment_detail = SalesOrderShipmentSerializer(
|
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
|
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):
|
class DuplicatePartSerializer(serializers.Serializer):
|
||||||
|
Reference in New Issue
Block a user