Fix Dart API generation bugs; Add ability to generate API for path parameters (#2887)
* Fix bug in dartgen: Import path should match the generated api filename * Use Route.HandlerName as generated dart API function name Reasons: - There is bug when using url path name as function name, because it may have invalid characters such as ":" - Switching to HandlerName aligns with other languages such as typescript generation * [DartGen] Add ability to generate api for url path parameters such as /path/:param
This commit is contained in:
@@ -3,13 +3,16 @@ package dartgen
|
||||
import "text/template"
|
||||
|
||||
var funcMap = template.FuncMap{
|
||||
"getBaseName": getBaseName,
|
||||
"getPropertyFromMember": getPropertyFromMember,
|
||||
"isDirectType": isDirectType,
|
||||
"isClassListType": isClassListType,
|
||||
"getCoreType": getCoreType,
|
||||
"pathToFuncName": pathToFuncName,
|
||||
"lowCamelCase": lowCamelCase,
|
||||
"getBaseName": getBaseName,
|
||||
"getPropertyFromMember": getPropertyFromMember,
|
||||
"isDirectType": isDirectType,
|
||||
"isClassListType": isClassListType,
|
||||
"getCoreType": getCoreType,
|
||||
"lowCamelCase": lowCamelCase,
|
||||
"normalizeHandlerName": normalizeHandlerName,
|
||||
"hasUrlPathParams": hasUrlPathParams,
|
||||
"extractPositionalParamsFromPath": extractPositionalParamsFromPath,
|
||||
"makeDartRequestUrlPath": makeDartRequestUrlPath,
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user