X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Fgenerate.sh;h=ffe7299ca866758a2b5eaf28a7ab5fc7db50a3e4;hb=c01d387b9ff3b5da35e6d9a635523e6747c5b72c;hp=f3cf738079c41e7dfc2d49db086498645dc548d8;hpb=c2422dba52b7c2fe640ff957137ccf64d2c96753;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/generate.sh b/capifcore/generate.sh index f3cf738..ffe7299 100755 --- a/capifcore/generate.sh +++ b/capifcore/generate.sh @@ -52,6 +52,7 @@ jar xvf common29554apidef.zip jar xvf common29571apidef.zip jar xvf common29572apidef.zip +# Remove types that are not used by CAPIF that have dependencies to other specifications. sed -e 'H;x;/^\( *\)\n\1/{s/\n.*//;x;d;}' -e 's/.*//;x;/\CivicAddress/{s/^\( *\).*/ \1/;x;d;}' TS29571_CommonData.yaml >temp.yaml mv temp.yaml TS29571_CommonData.yaml sed -e 'H;x;/^\( *\)\n\1/{s/\n.*//;x;d;}' -e 's/.*//;x;/\ExternalMbsServiceArea/{s/^\( *\).*/ \1/;x;d;}' TS29571_CommonData.yaml >temp.yaml @@ -72,6 +73,8 @@ sed -e 'H;x;/^\( *\)\n\1/{s/\n.*//;x;d;}' -e 's/.*//;x;/\MbsSession/{s/^\( *\). mv temp.yaml TS29571_CommonData.yaml sed -e 'H;x;/^\( *\)\n\1/{s/\n.*//;x;d;}' -e 's/.*//;x;/\SpatialValidityCond/{s/^\( *\).*/ \1/;x;d;}' TS29571_CommonData.yaml >temp.yaml mv temp.yaml TS29571_CommonData.yaml + +# Remove attributes that can not be generated easily. sed '/accessTokenError.*/,+3d' TS29571_CommonData.yaml >temp.yaml mv temp.yaml TS29571_CommonData.yaml sed '/accessTokenRequest.*/,+3d' TS29571_CommonData.yaml >temp.yaml @@ -80,9 +83,8 @@ mv temp.yaml TS29571_CommonData.yaml sed '/oneOf.*/,+2d' TS29222_CAPIF_Publish_Service_API.yaml >temp.yaml mv temp.yaml TS29222_CAPIF_Publish_Service_API.yaml -sed '64,68d' TS29222_CAPIF_Discover_Service_API.yaml >temp.yaml # Remove parameter preferred-aef-loc since it doesn't follow the OpenApi specification, "The behavior for nested objects and arrays is undefined." -mv temp.yaml TS29222_CAPIF_Discover_Service_API.yaml - +# Replace references to external specs that are collected to the common spec by the commoncollector +# cat TS29122_CommonData.yaml | sed 's/TS29572_Nlmf_Location/CommonData/g' > temp.yaml mv temp.yaml TS29122_CommonData.yaml cat TS29122_CommonData.yaml | sed 's/TS29554_Npcf_BDTPolicyControl/CommonData/g' > temp.yaml @@ -93,8 +95,6 @@ cat TS29571_CommonData.yaml | sed 's/TS29514_Npcf_PolicyAuthorization/CommonData mv temp.yaml TS29571_CommonData.yaml cat TS29571_CommonData.yaml | sed 's/TS29572_Nlmf_Location/CommonData/g' > temp.yaml mv temp.yaml TS29571_CommonData.yaml -cat TS29571_CommonData.yaml | sed 's/TS29571_CommonData.yaml//g' > temp.yaml # This spec has references to itself that need to be removed -mv temp.yaml TS29571_CommonData.yaml cat TS29222_CAPIF_Publish_Service_API.yaml | sed 's/TS29572_Nlmf_Location/CommonData/g' > temp.yaml mv temp.yaml TS29222_CAPIF_Publish_Service_API.yaml cat TS29222_CAPIF_Routing_Info_API.yaml | sed 's/TS29520_Nnwdaf_EventsSubscription/CommonData/g' > temp.yaml @@ -103,9 +103,11 @@ cat TS29222_CAPIF_Routing_Info_API.yaml | sed 's/TS29510_Nnrf_NFManagement/Commo mv temp.yaml TS29222_CAPIF_Routing_Info_API.yaml cat TS29222_CAPIF_Events_API.yaml | sed 's/TS29523_Npcf_EventExposure/CommonData/g' > temp.yaml mv temp.yaml TS29222_CAPIF_Events_API.yaml +# -go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.10.1 -PATH=$PATH:~/go/bin +# This spec has references to itself that need to be removed +cat TS29571_CommonData.yaml | sed 's/TS29571_CommonData.yaml//g' > temp.yaml +mv temp.yaml TS29571_CommonData.yaml cd $cwd @@ -128,6 +130,9 @@ go build . cd $cwd +go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.10.1 +PATH=$PATH:~/go/bin + echo "Generating TS29122_CommonData" mkdir -p internal/common29122 oapi-codegen --config gogeneratorspecs/common29122/generator_settings.yaml specs/TS29122_CommonData.yaml