File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ import yaml
2
+ import argparse
3
+
4
+ def main (args ):
5
+
6
+ if args .beta :
7
+ spec_src = './fern/apis/beta/openapi-beta.yaml'
8
+
9
+ get_specs (spec_src )
10
+
11
+ def get_specs (src ):
12
+
13
+ with open (src , 'r' ) as s :
14
+ spec = yaml .safe_load (s )
15
+ apis = {}
16
+ for endp , defn in spec ['paths' ].items ():
17
+ apis [endp ] = {'tags' : defn .get ('tags' )}
18
+ for prop , desc in defn .items ():
19
+ apis [endp ] = {prop : desc .get ('operationId' )}
20
+ print (apis )
21
+
22
+ if __name__ == "__main__" :
23
+ parser = argparse .ArgumentParser (description = "Generate release notes" )
24
+ parser .add_argument ('--beta' , default = True ,
25
+ action = argparse .BooleanOptionalAction )
26
+ parser .add_argument ('--public' , default = False ,
27
+ action = argparse .BooleanOptionalAction )
28
+ args = parser .parse_args ()
29
+ if (args .beta or args .public ):
30
+ main (args )
31
+ else :
32
+ print ("Specify --beta, --public, or both." )
You can’t perform that action at this time.
0 commit comments