Skip to content

ComplexType objects incorrectly require @odata.type property #647

@openUBMC-PLUSONE

Description

@openUBMC-PLUSONE

When validating a Certificate resource (e.g., Certificate.v1_3_0.Certificate), the validator reports the following error for the embedded Issuer property:

Required Property Error: The property '@odata.type' is mandatory, but not present in the payload.
Path: Issuer/@odata.type
Schema Definition
In the CSDL schema (certificate_v1.xml), the Issuer property is defined as:

<Property Name="Issuer" Type="Certificate.v1_0_0.Identifier" Nullable="false">
  <Annotation Term="OData.Description" String="The issuer of the certificate."/>
</Property>

The Identifier type is a ComplexType, not an EntityType:

  <ComplexType Name="Identifier">
    <Annotation Term="OData.AdditionalProperties" Bool="false"/>
    <Property Name="CommonName" Type="Edm.String" Nullable="false"/>
    <Property Name="Organization" Type="Edm.String" Nullable="false"/>
    ...
  </ComplexType>

In metadata.py (line 74-75), both EntityType and ComplexType are processed identically through the _add_object() method:

  if (child.tag == ODATA_TAG_ENTITY) or (child.tag == ODATA_TAG_COMPLEX):
      self._add_object(child)

The validator does not distinguish between EntityType and ComplexType. Does this cause it incorrectly requires @odata.type for ComplexType objects, then causing validation failures for conformant Redfish services?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions