Skip to content

Commit

Permalink
feat: add patch to force endpoint empty array
Browse files Browse the repository at this point in the history
  • Loading branch information
HJ-Fan committed Aug 9, 2024
1 parent 1a8d185 commit a4e86d9
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,8 @@ generate-redfish:
docker run -u $(GENERATE_USER) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v7.0.0 generate -i /local/$(OPENAPI_REDFISH_YAML) -g go-server -o /local/pkg/redfishapi --package-name redfishapi --additional-properties=sourceFolder=,outputAsLibrary=true,router=mux,serverPort=8080,enumClassPrefix=true -t /local/api/templates/go-server --skip-validate-spec
@echo "Format files after generation to conform to project standard"
docker run --rm -v ${PWD}:/local golang:$(GO_VERSION) $(GOFMT_OPTS)
@echo "Apply local patch for xml response fix"
git apply api/patch/Apply-xml-workaround-to-fix-metadata-response.patch
@echo "Apply local patch for missing import"
git apply api/patch/fix-missing-import.patch
@echo "Apply local patch for redfish auto generated codes"
git apply api/patch/*.redfish.patch

generate-axios:
@echo "Generating $(OPENAPI_YAML) axios server using openapi-generator-cli"
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions api/patch/force-endpoint-even-when-there-is-no-link.redfish.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From e3add1887e6d256b255d5fd48f5e1d2bbe4402c8 Mon Sep 17 00:00:00 2001
From: Hongjian Fan <[email protected]>
Date: Fri, 9 Aug 2024 08:16:44 -0500
Subject: [PATCH] patch: force endpoint even when there is no link

---
pkg/redfishapi/model_memory_chunks_v1_6_1_links.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go b/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go
index 6f6d6f2..176899b 100644
--- a/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go
+++ b/pkg/redfishapi/model_memory_chunks_v1_6_1_links.go
@@ -18,10 +18,10 @@ type MemoryChunksV161Links struct {
CXLLogicalDevicesodataCount int64 `json:"[email protected],omitempty"`

// An array of links to the endpoints that connect to this memory chunk.
- Endpoints []OdataV4IdRef `json:"Endpoints,omitempty"`
+ Endpoints []OdataV4IdRef `json:"Endpoints"` // manual change to force endpoint even when there is no link

// The number of items in a collection.
- EndpointsodataCount int64 `json:"[email protected],omitempty"`
+ EndpointsodataCount int64 `json:"[email protected]"` // manual change to force endpoint even when there is no link

// An array of links to the memory regions for which this memory chunk provides capacity.
MemoryRegions []OdataV4IdRef `json:"MemoryRegions,omitempty"`
--
2.25.1

0 comments on commit a4e86d9

Please sign in to comment.