From 0ee2cd5ece4bf4ac13dee030162f902b248c910d Mon Sep 17 00:00:00 2001 From: frikky Date: Mon, 24 Aug 2020 09:34:09 +0200 Subject: [PATCH] #120: Fixed dot issue in path during code generation --- backend/go-app/codegen.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/go-app/codegen.go b/backend/go-app/codegen.go index f620cc7f..366130b0 100644 --- a/backend/go-app/codegen.go +++ b/backend/go-app/codegen.go @@ -245,6 +245,8 @@ func buildStructure(swagger *openapi3.Swagger, curHash string) (string, error) { // This function generates the python code that's being used. // This is really meta when you program it. Handling parameters is hard here. func makePythoncode(swagger *openapi3.Swagger, name, url, method string, parameters, optionalQueries, headers []string) (string, string) { + log.Printf("makePythoncode URL: %s", url) + method = strings.ToLower(method) queryString := "" queryData := "" @@ -398,6 +400,8 @@ func makePythoncode(swagger *openapi3.Swagger, name, url, method string, paramet verifyAddin, ) + log.Printf(data) + //log.Printf("%s", data) return functionname, data } @@ -594,10 +598,12 @@ func generateYaml(swagger *openapi3.Swagger, newmd5 string) (*openapi3.Swagger, pythonFunctions := []string{} for actualPath, path := range swagger.Paths { actualPath = strings.Replace(actualPath, " ", "_", -1) - actualPath = strings.Replace(actualPath, ".", "", -1) - actualPath = strings.Replace(actualPath, ".", "", -1) + //actualPath = strings.Replace(actualPath, ".", "", -1) actualPath = strings.Replace(actualPath, "\\", "", -1) + // FIXME: Handle everything behind questionmark (?) with dots as well. + log.Printf("ActualPath: %s", actualPath) + // https://godoc.org/github.com/getkin/kin-openapi/openapi3#PathItem if path.Get != nil { action, curCode := handleGet(swagger, api, extraParameters, path, actualPath)