File tree 2 files changed +11
-5
lines changed
2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ def get_v1_categories_count():
22
22
finally :
23
23
conn .close ()
24
24
25
- @router .get ('/v1/collections/: collectionId/categories/count' )
25
+ @router .get ('/v1/collections/{ collectionId} /categories/count' )
26
26
def get_v1_collections_collection_id_categories_count ():
27
27
conn = psycopg2 .connect (
28
28
database = os .getenv ('DB_NAME' ),
@@ -46,7 +46,7 @@ def get_list_v1_categories():
46
46
def post_v1_categories ():
47
47
pass
48
48
49
- @router .get ('/v1/categories/: categoryId' )
49
+ @router .get ('/v1/categories/{ categoryId} ' )
50
50
def get_v1_categories_category_id ():
51
51
conn = psycopg2 .connect (
52
52
database = os .getenv ('DB_NAME' ),
@@ -62,11 +62,11 @@ def get_v1_categories_category_id():
62
62
finally :
63
63
conn .close ()
64
64
65
- @router .put ('/v1/categories/: categoryId' )
65
+ @router .put ('/v1/categories/{ categoryId} ' )
66
66
def put_v1_categories_category_id ():
67
67
pass
68
68
69
- @router .delete ('/v1/categories/: categoryId' )
69
+ @router .delete ('/v1/categories/{ categoryId} ' )
70
70
def delete_v1_categories_category_id ():
71
71
pass
72
72
Original file line number Diff line number Diff line change @@ -12,8 +12,14 @@ function generate_method_name(method, path) {
12
12
return ` ${ method}${ name} `
13
13
}
14
14
15
+ // "/categories/:categoryId" => "/categories/{categoryId}"
16
+ function convertToFastApiPath (path ) {
17
+ return path .replace (/ :([_a-zA-Z ] + )/ g , ' {$1}' )
18
+ }
19
+
20
+
15
21
endpoints .forEach (function (endpoint ) {
16
- const path = endpoint .path
22
+ const path = convertToFastApiPath ( endpoint .path )
17
23
18
24
endpoint .methods .forEach (function (method ) {
19
25
const hasGetOne = method .name === ' get'
You can’t perform that action at this time.
0 commit comments