diff options
Diffstat (limited to 'generic-resource-api/model/swagger/fixModuleUri.sh')
-rwxr-xr-x | generic-resource-api/model/swagger/fixModuleUri.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/generic-resource-api/model/swagger/fixModuleUri.sh b/generic-resource-api/model/swagger/fixModuleUri.sh index fae3872c..4c001867 100755 --- a/generic-resource-api/model/swagger/fixModuleUri.sh +++ b/generic-resource-api/model/swagger/fixModuleUri.sh @@ -1,5 +1,13 @@ #!/bin/sh +# fixModuleUri.sh : rewrites swagger to insert module name at beginning +# of URI (e.g. /rests/operations/GENERIC-RESOURCE-API:service-topology-operation) +# and to outer "output" tag, to be consistent with OpenDaylight ideosyncracies +# arguments: +# $1 - module name +# $2 - swagger file name +# +# Note: this was tested to work with yaml version of swagger mv $2 $2.backup -cat $2.backup | sed -e 's/'$1':/_&/1' -e 's/\([^_]\)'$1':/\//g' -e 's/_\('$1':\)/\1/' > $2 +cat $2.backup | sed -e 's/\/operations\//\/operations\/'$1':/g' -e 's/\/data\//\/data\/'$1':/g' -e 's/output:/\"'$1':output\":/g'> $2 rm $2.backup |