@@ -112,7 +112,7 @@ set-ratelimit: guard-APIM_ENV
112112 < specification/x-nhsd-apim/ratelimit-template.yaml > specification/x-nhsd-apim/ratelimit.yaml
113113
114114update-spec-template : guard-APIM_ENV
115- ifeq ($(APIM_ENV ) , $(filter $(APIM_ENV ) , sandbox internal-dev int ref preprod prod ) )
115+ ifeq ($(APIM_ENV ) , $(filter $(APIM_ENV ) , sandbox internal-dev test int ref preprod prod ) )
116116 @ $(MAKE) set-target APIM_ENV=$$APIM_ENV
117117 @ $(MAKE) set-access APIM_ENV=$$APIM_ENV
118118 @ $(MAKE) set-security APIM_ENV=$$APIM_ENV
@@ -123,10 +123,15 @@ else
123123endif
124124
125125construct-spec : guard-APIM_ENV
126- @ $(MAKE ) update-spec-template APIM_ENV=$$ APIM_ENV
127- mkdir -p build/specification/$(APIM_ENV ) && \
128- npx redocly bundle specification/eligibility-signposting-api.yaml --remove-unused-components --keep-url-references --ext yaml \
129- > build/specification/$(APIM_ENV ) /eligibility-signposting-api.yaml
126+ @ $(MAKE ) update-spec-template APIM_ENV=$$ APIM_ENV
127+ mkdir -p build/specification/$(APIM_ENV )
128+ ifeq ($(APIM_ENV ) , sandbox)
129+ sed '/^[[:space:]]*security:/,/^[[:space:]]*-[[:space:]]/c\ security:\n - app-level0: []' specification/eligibility-signposting-api.yaml > specification/eligibility-signposting-api.generated.yaml && \
130+ npx redocly bundle specification/eligibility-signposting-api.generated.yaml --remove-unused-components --keep-url-references --ext yaml > build/specification/$(APIM_ENV)/eligibility-signposting-api.yaml
131+ rm specification/eligibility-signposting-api.generated.yaml
132+ else
133+ npx redocly bundle specification/eligibility-signposting-api.yaml --remove-unused-components --keep-url-references --ext yaml > build/specification/$(APIM_ENV)/eligibility-signposting-api.yaml
134+ endif
130135
131136
132137SPEC_DIR := $(CURDIR ) /specification
0 commit comments