DMTF / Redfish-Tools

DMTF-produced tools to support the Redfish Specification
Other
81 stars 35 forks source link

Reformatted usage to use oneOf to ensure it doesn't collide with the nullable usage #471

Closed mraineri closed 6 months ago

mraineri commented 7 months ago

Fix #464

@commonism FYI here are the before and after for some properties:

Before...

        Description:
          $ref: http://redfish.dmtf.org/schemas/v1/Resource.yaml#/components/schemas/Resource_Description
          nullable: true
          readOnly: true

        EnvironmentalClass:
          $ref: '#/components/schemas/Chassis_v1_25_0_EnvironmentalClass'
          description: The ASHRAE Environmental Class for this chassis.
          nullable: true
          readOnly: false
          x-longDescription: This property shall contain the ASHRAE Environmental
            Class for this chassis, as defined by ASHRAE Thermal Guidelines for Data
            Processing Environments.  These classes define respective environmental
            limits that include temperature, relative humidity, dew point, and maximum
            allowable elevation.
          x-versionAdded: v1_9_0

        IPv4StaticAddresses:
          description: The IPv4 static addresses assigned to this interface.  See
            IPv4Addresses for the addresses in use by this interface.
          items:
            $ref: http://redfish.dmtf.org/schemas/v1/IPAddresses.yaml#/components/schemas/IPAddresses_IPv4Address
            nullable: true
          type: array
          x-longDescription: This property shall contain an array of objects that
            represent all IPv4 static addresses assigned to, but not necessarily in
            use by, this interface.  The IPv4Addresses property shall also list the
            addresses that this interface uses.
          x-versionAdded: v1_4_0

After...

        Description:
          oneOf:
          - $ref: http://redfish.dmtf.org/schemas/v1/Resource.yaml#/components/schemas/Resource_Description
          - enum:
            - 'null'
          readOnly: true

        EnvironmentalClass:
          description: The ASHRAE Environmental Class for this chassis.
          oneOf:
          - $ref: '#/components/schemas/Chassis_v1_25_0_EnvironmentalClass'
          - enum:
            - 'null'
          readOnly: false
          x-longDescription: This property shall contain the ASHRAE Environmental
            Class for this chassis, as defined by ASHRAE Thermal Guidelines for Data
            Processing Environments.  These classes define respective environmental
            limits that include temperature, relative humidity, dew point, and maximum
            allowable elevation.
          x-versionAdded: v1_9_0

        IPv4StaticAddresses:
          description: The IPv4 static addresses assigned to this interface.  See
            IPv4Addresses for the addresses in use by this interface.
          items:
            oneOf:
            - $ref: http://redfish.dmtf.org/schemas/v1/IPAddresses.yaml#/components/schemas/IPAddresses_IPv4Address
            - enum:
              - 'null'
          type: array
          x-longDescription: This property shall contain an array of objects that
            represent all IPv4 static addresses assigned to, but not necessarily in
            use by, this interface.  The IPv4Addresses property shall also list the
            addresses that this interface uses.
          x-versionAdded: v1_4_0
commonism commented 7 months ago

I had a look on the json schemas and guess this is the minimal invasive solution possible.