Redfish-Service-Validator icon indicating copy to clipboard operation
Redfish-Service-Validator copied to clipboard

DSP2043 validation

Open commonism opened this issue 1 year ago • 2 comments

Hi,

using the DSP8010_2024.1 & 1.2.6 Swordfish OpenAPI schemas I validated all DSP2043 mock files.

189 failed, 2864 passed, 1 warning in 62.05s (0:01:02)

failed.txt

FAILED tests/test_dsp2043.py::test_dsp2043_file[public-power-shelf::EventService/Subscriptions/1/index.json] - pydantic_core._pydantic_core.ValidationError: 1 validation error for EventDestination_v1_14_1_EventDestination

It's a mix of different issues:

autoExpand LogEntryCollections

>       r = type_.model_validate(data)
E       pydantic_core._pydantic_core.ValidationError: 10 validation errors for LogEntryCollection_LogEntryCollection
E       Members.0.`@odata.type`
E         Extra inputs are not permitted [type=extra_forbidden, input_value='#LogEntry.v1_16_1.LogEntry', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.5/v/extra_forbidden
E       Members.0.Id
E         Extra inputs are not permitted [type=extra_forbidden, input_value='1', input_type=str]
E           For further information visit https://errors.pydantic.dev/2.5/v/extra_forbidden
E       Members.0.Name

missing properties

E       pydantic_core._pydantic_core.ValidationError: 3 validation errors for ComponentIntegrity_v1_2_3_ComponentIntegrity
E       `@odata.id`
E         Field required [type=missing, input_value={'@odata.type': '#Compone...ut/policies/copyright.'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/missing
E       ComponentIntegrityTypeVersion
E         Field required [type=missing, input_value={'@odata.type': '#Compone...ut/policies/copyright.'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/missing
E       Name
E         Field required [type=missing, input_value={'@odata.type': '#Compone...ut/policies/copyright.'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/missing
E       pydantic_core._pydantic_core.ValidationError: 1 validation error for Chassis_v1_25_1_Chassis
E       ChassisType
E         Field required [type=missing, input_value={'@odata.type': '#Chassis...ut/policies/copyright.'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/missing

unknown properties

E       pydantic_core._pydantic_core.ValidationError: 2 validation errors for Thermal_v1_7_3_Thermal
E       Fans.0
E         Value error, unmatched property ReadingRPM [type=value_error, input_value={'@odata.id': '/redfish/v.../Chassis/CXL-Chassis'}]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/value_error
E       Fans.1
E         Value error, unmatched property ReadingRPM [type=value_error, input_value={'@odata.id': '/redfish/v.../Chassis/CXL-Chassis'}]}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/value_error

pathes without PathItem definition

tests.test_dsp2043.RoutingError: /redfish/v1/UpdateService/ClientCertificates/1/RekeyActionInfo
tests.test_dsp2043.RoutingError: /redfish/v1/Managers/1/EthernetInterfaces/1/SD
tests.test_dsp2043.RoutingError: /redfish/v1/EventService/SubmitTestEventActionInfo

Focussing on a single entry …

E       pydantic_core._pydantic_core.ValidationError: 1 validation error for EventDestination_v1_14_1_EventDestination
E       SubscriptionType
E         Field required [type=missing, input_value={'@odata.type': '#EventDe...ut/policies/copyright.'}, input_type=dict]
E           For further information visit https://errors.pydantic.dev/2.5/v/missing

the definition is

    EventDestination_v1_14_1_EventDestination:
…
      properties:
…
        SubscriptionType:
          description: The subscription type for events.
          oneOf:
          - $ref: '#/components/schemas/EventDestination_v1_14_1_SubscriptionType'
          - enum:
            - 'null'
…
      required:
      - SubscriptionType

and the data

# public-pdu/EventService/Subscriptions/1/index.json
{
    "@odata.type": "#EventDestination.v1_14_1.EventDestination",
    "Id": "1",
    "Name": "EventSubscription 1",
    "Destination": "http://www.dnsname.com/Destination1",
    "EventTypes": [
        "Alert"
    ],
    "Context": "WebUser3",
    "Protocol": "Redfish",
    "@odata.id": "/redfish/v1/EventService/Subscriptions/1",
    "@Redfish.Copyright": "Copyright 2014-2023 DMTF. For the full DMTF copyright policy, see http://www.dmtf.org/about/policies/copyright."
}

SubscriptionType is missing. Is this a problem with the DSP2043 data due to missing validation or the generated OpenAPI specification?

commonism avatar May 24 '24 16:05 commonism