From 210d2b32bddb8b7d3bc6312277fd92cde37562ba Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 8 Oct 2025 13:39:38 +0100 Subject: [PATCH] api: Allow bios values to be None Despite what the api-ref says [1], the 'bios.[*].value' field included in responses to 'GET /v1/nodes/{node_ident}/bios' can be null. The BIOSSetting database model in 'ironic.db.sqlalchemy.models' confirms as much. Update the schema and api-ref to reflect this. This leaves only the 'name' and 'created_at' fields as non-nullable. Change-Id: Idcc03e6ce377ecf6b9db511e3283fb6f2496b037 Signed-off-by: Stephen Finucane Closes-bug: #2127079 --- api-ref/source/parameters.yaml | 2 +- ironic/api/schemas/v1/bios.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml index 0b32bd5524..95feeb8d45 100644 --- a/api-ref/source/parameters.yaml +++ b/api-ref/source/parameters.yaml @@ -628,7 +628,7 @@ bios_setting_upper_bound: type: integer bios_setting_value: description: | - The value of a Bios setting for a Node, eg. "on". + The value of a Bios setting for a Node, eg. "on". May be ``null``. in: body required: true type: string diff --git a/ironic/api/schemas/v1/bios.py b/ironic/api/schemas/v1/bios.py index 01290854ac..4cdb5da878 100644 --- a/ironic/api/schemas/v1/bios.py +++ b/ironic/api/schemas/v1/bios.py @@ -82,7 +82,7 @@ _bios_response_body = { 'links': response_types.links, 'name': {'type': 'string'}, 'updated_at': {'type': ['string', 'null'], 'format': 'date-time'}, - 'value': {'type': 'string'}, + 'value': {'type': ['null', 'string']}, }, 'required': ['created_at', 'links', 'name', 'value', 'updated_at'], 'additionalProperties': False, @@ -106,7 +106,7 @@ _bios_response_body_v74 = { 'unique': {'type': ['null', 'boolean']}, 'updated_at': {'type': ['string', 'null'], 'format': 'date-time'}, 'upper_bound': {'type': ['null', 'integer'], 'minimum': 0}, - 'value': {'type': 'string'}, + 'value': {'type': ['null', 'string']}, }, # NOTE(stephenfin): The 'fields' parameter means only a minimal set of # fields are required