Skip to content

Commit b85ba0b

Browse files
authored
Merge pull request #9 from HydrologicEngineeringCenter/bugfix/8-npm-readme-version
Apply genVer-todaysDate to OpenAPI spec
2 parents d39eeea + 83f5459 commit b85ba0b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

scripts/spec-updates/modSpec.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
#!/usr/bin/env bash
22

3+
# Set date variable for use in version
4+
printf -v date '%(%Y.%m.%d)T'
5+
36
# Add default servers to spec
47
npx node-jq '.servers = inputs.servers' cwms-swagger-raw.json scripts/spec-updates/servers.json |
58

9+
# Write version as genVer-todaysDate
10+
# This will be used until CDA itself exposes an official CalVer version
11+
npx node-jq --arg date "$date" --slurpfile root package.json '.info.version = ($root[0].version + "-" + $date)' |
12+
613
# Add BaseRatingMetadata to fix typing issues
714
npx node-jq --slurpfile base scripts/spec-updates/BaseRatingMetadata.json '.components.schemas.BaseRatingMetadata = $base[0].BaseRatingMetadata' |
815
sed 's/"\$ref": "#\/components\/schemas\/AbstractRatingMetadata"/"\$ref": "#\/components\/schemas\/BaseRatingMetadata"/g' |

0 commit comments

Comments
 (0)