read database info from file
This commit is contained in:
@ -75,6 +75,7 @@ statementChecker = {
|
||||
'delete': re.compile('^delete', re.IGNORECASE),
|
||||
'post': re.compile('^insert', re.IGNORECASE)
|
||||
}
|
||||
databaseTagFinder = re.compile('DATABASETAGBEGIN (.*) DATABASETAGEND')
|
||||
|
||||
operations = []
|
||||
for path in apiDefinition['paths'].values():
|
||||
@ -100,6 +101,9 @@ for path in apiDefinition['paths'].values():
|
||||
statement = statementFinderResult.group(1)
|
||||
if not statementChecker[method].match(statement):
|
||||
raise Exception(f"Invalid statement {statement} for method {method}")
|
||||
databaseTagFinderResult = databaseTagFinder.search(description)
|
||||
if databaseTagFinderResult:
|
||||
databaseTag = databaseTagFinderResult.group(1)
|
||||
|
||||
bodyInputType = {}
|
||||
if 'requestBody' in operation:
|
||||
@ -124,6 +128,7 @@ for path in apiDefinition['paths'].values():
|
||||
'allSelector': operation['operationId'].endswith('all'),
|
||||
'byIdSelector': operation['operationId'].endswith('byid'),
|
||||
'statement': statement,
|
||||
'databaseTag': databaseTag,
|
||||
'bodyInputType': bodyInputType,
|
||||
'paramInputTypes': paramInputTypes
|
||||
})
|
||||
|
Reference in New Issue
Block a user