Skip to content

Commit

Permalink
redfish-gen: Fixed Redfish-Service-Validator error in @odata.id
Browse files Browse the repository at this point in the history
Create common Redfish class with common functionality to
share same Redfish related functionaly in the 'redfish-gen'
tool.

Part of BBMC-1462

End-User-Impact: None: (Code optimization without change
                        functionality)

Signed-off-by: Sergey Gulyaev <[email protected]>
  • Loading branch information
Sergey Gulyaev committed Feb 27, 2023
1 parent 1bf7793 commit 6dcedd2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/redfish-gen/redfish_gen/redfish_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def __prepare_oem_schemas():
@staticmethod
def __resolve_remaining_schemas():
"""
Runs over added schemas and resolve they in cycle
Runs over added schemas and resolve they in cycle
until new ones will be resolved.
"""
resolve_iterations = 10
Expand Down Expand Up @@ -380,9 +380,14 @@ def __generate_json_schema_index(standard: str, schema_spec_name, relative_schem

@staticmethod
def __json_schema_index_template():
# fix: in the "@odata.id" field, the <id> should be started with "/redfish/v1"
# to avoid the following errors:
#
# "ERROR - URI /redfish/swordfish/v1/JsonSchemas/ClassOfService does not match
# the following required URIs in Schema of JsonSchemaFile.v1_0_2.JsonSchemaFile"
return '''{
"@odata.context": "/{standard}/{v}/$metadata#JsonSchemaFile.JsonSchemaFile",
"@odata.id": "/{standard}/{v}/{JsonSchemas}/{name}",
"@odata.context": "/redfish/{v}/$metadata#JsonSchemaFile.JsonSchemaFile",
"@odata.id": "/redfish/{v}/{JsonSchemas}/{name}",
"@odata.type": "#JsonSchemaFile.v1_0_2.JsonSchemaFile",
"Name": "{name} Schema File",
"Schema": "#{name}.{name}",
Expand Down

0 comments on commit 6dcedd2

Please sign in to comment.