File tree 3 files changed +23
-1
lines changed
3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ vendor/
24
24
# Docs generated from our openapi repo
25
25
api /cli.yml
26
26
api /cli.gen.yml
27
+ api /cli-stripped.gen.yml
27
28
api /cli-extras.gen.yml
28
29
29
30
# GPG private key generated by CI during release.
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ declare -r API_DIR="${ROOT_DIR}/api"
8
8
declare -r GENERATED_PATTERN=' ^// Code generated .* DO NOT EDIT\.$'
9
9
declare -r MERGE_DOCKER_IMG=quay.io/influxdb/swagger-cli
10
10
declare -r GENERATOR_DOCKER_IMG=openapitools/openapi-generator-cli:v5.1.0
11
+ declare -r TAG_STRIP_IMG=python:3.9-alpine3.15
11
12
12
13
# Clean up all the generated files in the target directory.
13
14
rm -f $( grep -Elr " ${GENERATED_PATTERN} " " ${API_DIR} " )
@@ -28,14 +29,19 @@ docker run --rm -it -u "$(id -u):$(id -g)" \
28
29
--outfile /api/cli-extras.gen.yml \
29
30
--type yaml
30
31
32
+ # Strip certain tags to prevent duplicated and conflicting codegen.
33
+ docker run --rm -it -u " $( id -u) :$( id -g) " \
34
+ -v " ${ROOT_DIR} " :/api \
35
+ ${TAG_STRIP_IMG} \
36
+ sh -c " python3 /api/etc/stripGroupTags.py /api/api/cli.gen.yml > /api/api/cli-stripped.gen.yml"
31
37
32
38
# Run the generator - This produces many more files than we want to track in git.
33
39
docker run --rm -it -u " $( id -u) :$( id -g) " \
34
40
-v " ${API_DIR} " :/api \
35
41
${GENERATOR_DOCKER_IMG} \
36
42
generate \
37
43
-g go \
38
- -i /api/cli.gen.yml \
44
+ -i /api/cli-stripped .gen.yml \
39
45
-o /api \
40
46
-t /api/templates \
41
47
--additional-properties packageName=api,enumClassPrefix=true,generateInterfaces=true
Original file line number Diff line number Diff line change
1
+ import sys
2
+ import re
3
+
4
+ blacklist = [
5
+ "Data I/O endpoints" ,
6
+ "Security and access endpoints" ,
7
+ "System information endpoints"
8
+ ]
9
+
10
+ if __name__ == "__main__" :
11
+ with open (sys .argv [1 ]) as f :
12
+ data = f .read ()
13
+ blItems = "|" .join (blacklist )
14
+ data = re .sub (f"- +({ blItems } )" , "" , data )
15
+ print (data )
You can’t perform that action at this time.
0 commit comments