Repository: deepmap/oapi-codegen
Pull request #107 (2019-12-19 21:58:23)

Remove special character for go names
This is a refinement of the work in #106 to address #105 

The OpenID spec I was given had operationIds such as: `POST_student-unenrolled-in-school` which resulted in invalid Go code. It now will more correctly remove special characters and camel case to be `NewPOSTStudentUnenrolledInSchoolRequestWithBody`. 

To  ensure that identifier names remain private (i.e. not exported because they start with a capital letter) they may still appear to be oddly cased as in `pOSTStudentUnenrolledInSchool`.  Correcting that would require prefixing as in `_POSTStudentUnenrolledInSchoolRequest` or `xPOSTStudentUnenrolledInSchoolRequest`.  

Also, use of "anyOf" or "oneOf" resulted in invalid Go code, since it would attempt to write `response.JSON200 = &interface{}{}` . This special cases `typeDefinition.Schema.TypeDecl()` of `interface{}` to generate valid go code, but does not otherwise extend the `anyOf` or `oneOf` support at this point.

I adjusted the travis Go version to 1.13 since the go.mod file specified 1.13, which I think is why the test in #106 appeared to fail in travis, but not locally. This appears to have happened since #84 was merged.


StevenACoffman: This PR will pass all the tests, but when you run `go generate ./...` you will get capitalization differences:
```
-// addPetJSONBody defines parameters for AddPet.
-type addPetJSONBody NewPet
+// AddPetJSONBody defines parameters for AddPet.
+type AddPetJSONBody NewPet

 // AddPetRequestBody defines body for AddPet for application/json ContentType.
-type AddPetJSONRequestBody addPetJSONBody
+type AddPetJSONRequestBody AddPetJSONBody
```
From the comment, it appears that line three of the `param-types.tmpl` has the `.TypeName` first character uppercased.
```
// {{.TypeName}} defines parameters for {{$opid}}.
```
StevenACoffman: Ok, I have the tests passing. However, in the existing generated files, I see oddities like in `petstore-client.gen.go`:
```
// ParsefindPetsResponse parses an HTTP response from a FindPetsWithResponse call
```
I would think this should be `ParseFindPetsResponse`, but the genResponseType method is used in too many places where it breaks lots of other things if this returns the correct type. Perhaps something to clean up in another PR if this is accepted.
StevenACoffman: @daolis can you see if this also meets your needs?
StevenACoffman: I think I corrected all the situations like `ParsegetTestByNameResponse` to be camel cased properly. This should be good to merge. 

Patch:
diff --git a/.travis.yml b/.travis.yml
index d5ade7a..0ddcf76 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
 language: go
 go:
-- 1.11.x
+- 1.13.x
 env:
   global:
   - GO111MODULE: 'on'
diff --git a/examples/petstore-expanded/chi/api/petstore.gen.go b/examples/petstore-expanded/chi/api/petstore.gen.go
index b757bfa..f01ccfe 100644
--- a/examples/petstore-expanded/chi/api/petstore.gen.go
+++ b/examples/petstore-expanded/chi/api/petstore.gen.go
@@ -46,11 +46,11 @@ type FindPetsParams struct {
 	Limit *int32 `json:"limit,omitempty"`
 }
 
-// addPetJSONBody defines parameters for AddPet.
-type addPetJSONBody NewPet
+// AddPetJSONBody defines parameters for AddPet.
+type AddPetJSONBody NewPet
 
 // AddPetRequestBody defines body for AddPet for application/json ContentType.
-type AddPetJSONRequestBody addPetJSONBody
+type AddPetJSONRequestBody AddPetJSONBody
 
 type ServerInterface interface {
 	//  (GET /pets)
@@ -189,33 +189,33 @@ func HandlerFromMux(si ServerInterface, r *chi.Mux) http.Handler {
 // Base64 encoded, gzipped, json marshaled Swagger object
 var swaggerSpec = []string{
 
-	"H4sIAAAAAAAC/+RXS28cy839K0R937LTo9gXWcwqju0AAnJtJU6yufaCqmbP8KIerSJrZEGY/x6wuudl",
-	"6coJEgQXyGYe3fU4PDxknXp0PscpJ0oqbv3oxG8pYvv5vpRc7MdU8kRFmdpjnwey7zGXiOrWjpO+fuU6",
-	"pw8TzX9pQ8XtOxdJBDdt9PJStHDauP2+c4XuKhca3Pqnec3T+C/7zn2g+xvSp9snjM8t2DnFzfc3arNt",
-	"+WVtDOHj6NY/Pbr/LzS6tfu/1YmP1ULGasGy774Fw8O3TPzuh2eY+AYED+7L/sveHnMa80xqUvQNEkXk",
-	"4NYOJ1bC+Hu5x82GSs/ZdUv07tP8DN7cXMNfCaPrXC02aas6rVerszn7zg0kvvCknJNbuzcgGKdAbbJu",
-	"UaEKCSBMpKK5EKAAJqCv8zDNMFDMSbSgEoyEWgsJcALdEnycKNlKr/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Oj2XO5X2ofVmOwakIMsYo0WJHMRjQW2",
+	"LEg9/FCLJSBp3cBVPlSBdopiyVPmBmfS735CULVUbOKxNRSMEHCtIZOfs9XD3+s0NSSveZuyR3XSzhFK",
+	"d2g+gNVqkUwjZ3lOYc/imJvMoRpVLJpg4NgdocyFG7nwHnBRDJalOlaopSBU2etsTuS00xlpbb8ebk4T",
+	"05ibMY6ZhGs46VyTaGp3om9tvf1nPeLUDbTjbuXM0vzA0en50o6NrARQLs1enB8Wgmvt+zCwF8pw/2TU",
+	"CpileaiUn47nvI4zp+ZhQF+om11acyBCoVz2Q9MDzBmf9H+Rp3YOqltpVuYcUsAvHLSv13BPGdIAmUr1",
+	"0nDmdrj9AkjPgeV1lN/0irs7nV9GbT4tnDdXV3tfRHGyauPoZ2ux+Lko5udLPLzm4yYT9xUzuxcOaSSB",
+	"PZjJPw1YvfwqPK/BmIz1hY1rpC+jNl/t0ocxYyoX/Mb7TCjNt0V6VMexN2TN3PQA13XCp2PU1HmfHsm9",
+	"kOw7p4qd00dFvk/u6X8W6d44vwz1hkSFhc7p1wH3mYwkV9r9l7r4phx+4+nfdZPvXDyz200q8CT0Ug/T",
+	"c9VD4bj21CRxj9pO0ySM1TWUqqgvqOC6zZ6E8GrnWl1raxin7M1Y5ragRvnYFdi9yOUvdYTLd6aXHeG7",
+	"l1ErkAmF+w1U6usXg8n4H1JySNTqugMejlcDl6hATAIb3NLxktAGjC1DFw+d759W7ldlbyCxm/9b8n5n",
+	"ZasHLuXtPg1nt/P9Rbs/ua7qnXN3t/tPAAAA//+bt4pKjxEAAA==",
 }
 
 // GetSwagger returns the Swagger specification corresponding to the generated code
diff --git a/examples/petstore-expanded/echo/api/petstore-server.gen.go b/examples/petstore-expanded/echo/api/petstore-server.gen.go
index 9533b5d..015b6b0 100644
--- a/examples/petstore-expanded/echo/api/petstore-server.gen.go
+++ b/examples/petstore-expanded/echo/api/petstore-server.gen.go
@@ -131,33 +131,33 @@ func RegisterHandlers(router interface {
 // Base64 encoded, gzipped, json marshaled Swagger object
 var swaggerSpec = []string{
 
-	"H4sIAAAAAAAC/+RXS28cy839K0R937LTo9gXWcwqju0AAnJtJU6yufaCqmbP8KIerSJrZEGY/x6wuudl",
-	"6coJEgQXyGYe3fU4PDxknXp0PscpJ0oqbv3oxG8pYvv5vpRc7MdU8kRFmdpjnwey7zGXiOrWjpO+fuU6",
-	"pw8TzX9pQ8XtOxdJBDdt9PJStHDauP2+c4XuKhca3Pqnec3T+C/7zn2g+xvSp9snjM8t2DnFzfc3arNt",
-	"+WVtDOHj6NY/Pbr/LzS6tfu/1YmP1ULGasGy774Fw8O3TPzuh2eY+AYED+7L/sveHnMa80xqUvQNEkXk",
-	"4NYOJ1bC+Hu5x82GSs/ZdUv07tP8DN7cXMNfCaPrXC02aas6rVerszn7zg0kvvCknJNbuzcgGKdAbbJu",
-	"UaEKCSBMpKK5EKAAJqCv8zDNMFDMSbSgEoyEWgsJcALdEnycKNlKr/srkIk8j+yxbdW5wJ6S0Clt7s2E",
-	"fkvwqr+6gCzr1er+/r7H9rrPZbNa5srqT9dv33/49P43r/qrfqsxtFxTifJx/ERlx56ei3vVhqwsGazh",
-	"nLObJUzXuR0VmUn5bX/VX9nKeaKEE7u1e90edW5C3bZkr4wg+7GZtXNJ619Ia0kCGEJjEsaSY2NIHkQp",
-	"zlTb/ypUYGske08ioPlz+oARhAbwOQ0cKWmNQKI9/IjkKaGAUpxyAcENq7KA4MSUOkjkoWxz8lVAKJ4N",
-	"YAWMpD28oUSYABU2BXc8IGDdVOoAPTD6GrhN7eFtLXjLWgvkgTOEXCh2kEvCQkAbUqBAC7pEvgNfi1QB",
-	"HiCQ1yo9vKssEBm0lomlg6mGHScstheVbEF3oJw8DzUp7LBwFfi5iuYerhNs0cPWQKAIwRRQCWFgrzUa",
-	"HddzSVksOPDE4jltAJNaNKfYA29qwGPk0xYLacEDiTYeYg4kygQcJyoDG1N/5x3GOSAMfFcxwsBozBQU",
-	"uLPYdhRYIeUEmovmYp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00dFvk/u6X8W6d44vwz1hkSFhc7p1wH3mYwkV9r9l7r4phx+4+nfdZPvXDyz200q8CT0Ug/T",
+	"c9VD4bj21CRxj9pO0ySM1TWUqqgvqOC6zZ6E8GrnWl1raxin7M1Y5ragRvnYFdi9yOUvdYTLd6aXHeG7",
+	"l1ErkAmF+w1U6usXg8n4H1JySNTqugMejlcDl6hATAIb3NLxktAGjC1DFw+d759W7ldlbyCxm/9b8n5n",
+	"ZasHLuXtPg1nt/P9Rbs/ua7qnXN3t/tPAAAA//+bt4pKjxEAAA==",
 }
 
 // GetSwagger returns the Swagger specification corresponding to the generated code
diff --git a/examples/petstore-expanded/echo/api/petstore-types.gen.go b/examples/petstore-expanded/echo/api/petstore-types.gen.go
index a08e862..79c6a2f 100644
--- a/examples/petstore-expanded/echo/api/petstore-types.gen.go
+++ b/examples/petstore-expanded/echo/api/petstore-types.gen.go
@@ -33,8 +33,8 @@ type FindPetsParams struct {
 	Limit *int32 `json:"limit,omitempty"`
 }
 
-// addPetJSONBody defines parameters for AddPet.
-type addPetJSONBody NewPet
+// AddPetJSONBody defines parameters for AddPet.
+type AddPetJSONBody NewPet
 
 // AddPetRequestBody defines body for AddPet for application/json ContentType.
-type AddPetJSONRequestBody addPetJSONBody
+type AddPetJSONRequestBody AddPetJSONBody
diff --git a/examples/petstore-expanded/petstore-client.gen.go b/examples/petstore-expanded/petstore-client.gen.go
index 007e263..507501d 100644
--- a/examples/petstore-expanded/petstore-client.gen.go
+++ b/examples/petstore-expanded/petstore-client.gen.go
@@ -46,11 +46,11 @@ type FindPetsParams struct {
 	Limit *int32 `json:"limit,omitempty"`
 }
 
-// addPetJSONBody defines parameters for AddPet.
-type addPetJSONBody NewPet
+// AddPetJSONBody defines parameters for AddPet.
+type AddPetJSONBody NewPet
 
 // AddPetRequestBody defines body for AddPet for application/json ContentType.
-type AddPetJSONRequestBody addPetJSONBody
+type AddPetJSONRequestBody AddPetJSONBody
 
 // RequestEditorFn  is the function signature for the RequestEditor callback function
 type RequestEditorFn func(req *http.Request, ctx context.Context) error
@@ -482,7 +482,7 @@ func (c *ClientWithResponses) FindPetsWithResponse(ctx context.Context, params *
 	if err != nil {
 		return nil, err
 	}
-	return ParsefindPetsResponse(rsp)
+	return ParseFindPetsResponse(rsp)
 }
 
 // AddPetWithBodyWithResponse request with arbitrary body returning *AddPetResponse
@@ -491,7 +491,7 @@ func (c *ClientWithResponses) AddPetWithBodyWithResponse(ctx context.Context, co
 	if err != nil {
 		return nil, err
 	}
-	return ParseaddPetResponse(rsp)
+	return ParseAddPetResponse(rsp)
 }
 
 func (c *ClientWithResponses) AddPetWithResponse(ctx context.Context, body AddPetJSONRequestBody) (*addPetResponse, error) {
@@ -499,7 +499,7 @@ func (c *ClientWithResponses) AddPetWithResponse(ctx context.Context, body AddPe
 	if err != nil {
 		return nil, err
 	}
-	return ParseaddPetResponse(rsp)
+	return ParseAddPetResponse(rsp)
 }
 
 // DeletePetWithResponse request returning *DeletePetResponse
@@ -508,7 +508,7 @@ func (c *ClientWithResponses) DeletePetWithResponse(ctx context.Context, id int6
 	if err != nil {
 		return nil, err
 	}
-	return ParsedeletePetResponse(rsp)
+	return ParseDeletePetResponse(rsp)
 }
 
 // FindPetByIdWithResponse request returning *FindPetByIdResponse
@@ -517,11 +517,11 @@ func (c *ClientWithResponses) FindPetByIdWithResponse(ctx context.Context, id in
 	if err != nil {
 		return nil, err
 	}
-	return ParsefindPetByIdResponse(rsp)
+	return ParseFindPetByIdResponse(rsp)
 }
 
-// ParsefindPetsResponse parses an HTTP response from a FindPetsWithResponse call
-func ParsefindPetsResponse(rsp *http.Response) (*findPetsResponse, error) {
+// ParseFindPetsResponse parses an HTTP response from a FindPetsWithResponse call
+func ParseFindPetsResponse(rsp *http.Response) (*findPetsResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -551,8 +551,8 @@ func ParsefindPetsResponse(rsp *http.Response) (*findPetsResponse, error) {
 	return response, nil
 }
 
-// ParseaddPetResponse parses an HTTP response from a AddPetWithResponse call
-func ParseaddPetResponse(rsp *http.Response) (*addPetResponse, error) {
+// ParseAddPetResponse parses an HTTP response from a AddPetWithResponse call
+func ParseAddPetResponse(rsp *http.Response) (*addPetResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -582,8 +582,8 @@ func ParseaddPetResponse(rsp *http.Response) (*addPetResponse, error) {
 	return response, nil
 }
 
-// ParsedeletePetResponse parses an HTTP response from a DeletePetWithResponse call
-func ParsedeletePetResponse(rsp *http.Response) (*deletePetResponse, error) {
+// ParseDeletePetResponse parses an HTTP response from a DeletePetWithResponse call
+func ParseDeletePetResponse(rsp *http.Response) (*deletePetResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -607,8 +607,8 @@ func ParsedeletePetResponse(rsp *http.Response) (*deletePetResponse, error) {
 	return response, nil
 }
 
-// ParsefindPetByIdResponse parses an HTTP response from a FindPetByIdWithResponse call
-func ParsefindPetByIdResponse(rsp *http.Response) (*findPetByIdResponse, error) {
+// ParseFindPetByIdResponse parses an HTTP response from a FindPetByIdWithResponse call
+func ParseFindPetByIdResponse(rsp *http.Response) (*findPetByIdResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
diff --git a/pkg/codegen/operations.go b/pkg/codegen/operations.go
index afb7748..916643d 100644
--- a/pkg/codegen/operations.go
+++ b/pkg/codegen/operations.go
@@ -385,7 +385,6 @@ func OperationDefinitions(swagger *openapi3.Swagger) ([]OperationDefinition, err
 		pathOps := pathItem.Operations()
 		for _, opName := range SortedOperationsKeys(pathOps) {
 			op := pathOps[opName]
-
 			// We rely on OperationID to generate function names, it's required
 			if op.OperationID == "" {
 				op.OperationID, err = generateDefaultOperationID(opName, requestPath)
@@ -393,6 +392,9 @@ func OperationDefinitions(swagger *openapi3.Swagger) ([]OperationDefinition, err
 					return nil, fmt.Errorf("error generating default OperationID for %s/%s: %s",
 						opName, requestPath, err)
 				}
+				op.OperationID = op.OperationID
+			} else {
+				op.OperationID = ToCamelCase(op.OperationID)
 			}
 
 			// These are parameters defined for the specific path method that
diff --git a/pkg/codegen/template_helpers.go b/pkg/codegen/template_helpers.go
index ae19f44..2afb7bd 100644
--- a/pkg/codegen/template_helpers.go
+++ b/pkg/codegen/template_helpers.go
@@ -111,6 +111,7 @@ func genResponseUnmarshal(op *OperationDefinition) string {
 	// Add a case for each possible response:
 	responses := op.Spec.Responses
 	for _, typeDefinition := range typeDefinitions {
+
 		responseRef, ok := responses[typeDefinition.ResponseName]
 		if !ok {
 			continue
@@ -150,19 +151,34 @@ func genResponseUnmarshal(op *OperationDefinition) string {
 
 			// JSON:
 			case StringInArray(contentTypeName, contentTypesJSON):
-				caseAction := fmt.Sprintf("response.%s = &%s{} \n if err := json.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.Schema.TypeDecl(), typeDefinition.TypeName)
+				var caseAction string
+				if typeDefinition.Schema.TypeDecl() == "interface{}" {
+					caseAction = fmt.Sprintf("var temp interface{}\nresponse.%s = &temp \n if err := json.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.TypeName)
+				} else {
+					caseAction = fmt.Sprintf("response.%s = &%s{} \n if err := json.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.Schema.TypeDecl(), typeDefinition.TypeName)
+				}
 				caseKey, caseClause := buildUnmarshalCase(typeDefinition, caseAction, "json")
 				caseClauses[caseKey] = caseClause
 
 			// YAML:
 			case StringInArray(contentTypeName, contentTypesYAML):
-				caseAction := fmt.Sprintf("response.%s = &%s{} \n if err := yaml.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.Schema.TypeDecl(), typeDefinition.TypeName)
+				var caseAction string
+				if typeDefinition.Schema.TypeDecl() == "interface{}" {
+					caseAction = fmt.Sprintf("var temp interface{}\nresponse.%s = &temp \n if err := yaml.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.TypeName)
+				} else {
+					caseAction = fmt.Sprintf("response.%s = &%s{} \n if err := yaml.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.Schema.TypeDecl(), typeDefinition.TypeName)
+				}
 				caseKey, caseClause := buildUnmarshalCase(typeDefinition, caseAction, "yaml")
 				caseClauses[caseKey] = caseClause
 
 			// XML:
 			case StringInArray(contentTypeName, contentTypesXML):
-				caseAction := fmt.Sprintf("response.%s = &%s{} \n if err := xml.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.Schema.TypeDecl(), typeDefinition.TypeName)
+				var caseAction string
+				if typeDefinition.Schema.TypeDecl() == "interface{}" {
+					caseAction = fmt.Sprintf("var temp interface{}\nresponse.%s = &temp \n if err := xml.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.TypeName)
+				} else {
+					caseAction = fmt.Sprintf("response.%s = &%s{} \n if err := xml.Unmarshal(bodyBytes, response.%s); err != nil { \n return nil, err \n}", typeDefinition.TypeName, typeDefinition.Schema.TypeDecl(), typeDefinition.TypeName)
+				}
 				caseKey, caseClause := buildUnmarshalCase(typeDefinition, caseAction, "xml")
 				caseClauses[caseKey] = caseClause
 
@@ -183,6 +199,7 @@ func genResponseUnmarshal(op *OperationDefinition) string {
 	// Now build the switch statement in order of most-to-least specific:
 	fmt.Fprintf(buffer, "switch {\n")
 	for _, caseClauseKey := range SortedStringKeys(caseClauses) {
+
 		fmt.Fprintf(buffer, "%s\n", caseClauses[caseClauseKey])
 	}
 	fmt.Fprintf(buffer, "}\n")
@@ -234,6 +251,7 @@ var TemplateFunctions = template.FuncMap{
 	"swaggerUriToEchoUri":        SwaggerUriToEchoUri,
 	"swaggerUriToChiUri":         SwaggerUriToChiUri,
 	"lcFirst":                    LowercaseFirstCharacter,
+	"ucFirst":                    UppercaseFirstCharacter,
 	"camelCase":                  ToCamelCase,
 	"genResponsePayload":         genResponsePayload,
 	"genResponseTypeName":        genResponseTypeName,
diff --git a/pkg/codegen/templates/client-with-responses.tmpl b/pkg/codegen/templates/client-with-responses.tmpl
index 17f80c7..e71f4be 100644
--- a/pkg/codegen/templates/client-with-responses.tmpl
+++ b/pkg/codegen/templates/client-with-responses.tmpl
@@ -65,7 +65,7 @@ func (c *ClientWithResponses) {{$opid}}{{if .HasBody}}WithBody{{end}}WithRespons
     if err != nil {
         return nil, err
     }
-    return Parse{{genResponseTypeName $opid}}(rsp)
+    return Parse{{genResponseTypeName $opid | ucFirst}}(rsp)
 }
 
 {{$hasParams := .RequiresParamObject -}}
@@ -77,7 +77,7 @@ func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Conte
     if err != nil {
         return nil, err
     }
-    return Parse{{genResponseTypeName $opid}}(rsp)
+    return Parse{{genResponseTypeName $opid | ucFirst}}(rsp)
 }
 {{end}}
 
@@ -86,8 +86,8 @@ func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Conte
 {{/* Generate parse functions for responses*/}}
 {{range .}}{{$opid := .OperationId}}
 
-// Parse{{genResponseTypeName $opid}} parses an HTTP response from a {{$opid}}WithResponse call
-func Parse{{genResponseTypeName $opid}}(rsp *http.Response) (*{{genResponseTypeName $opid}}, error) {
+// Parse{{genResponseTypeName $opid | ucFirst}} parses an HTTP response from a {{$opid}}WithResponse call
+func Parse{{genResponseTypeName $opid | ucFirst}}(rsp *http.Response) (*{{genResponseTypeName $opid}}, error) {
     bodyBytes, err := ioutil.ReadAll(rsp.Body)
     defer rsp.Body.Close()
     if err != nil {
diff --git a/pkg/codegen/templates/templates.gen.go b/pkg/codegen/templates/templates.gen.go
index aa175b8..37efc4d 100644
--- a/pkg/codegen/templates/templates.gen.go
+++ b/pkg/codegen/templates/templates.gen.go
@@ -337,7 +337,7 @@ func (c *ClientWithResponses) {{$opid}}{{if .HasBody}}WithBody{{end}}WithRespons
     if err != nil {
         return nil, err
     }
-    return Parse{{genResponseTypeName $opid}}(rsp)
+    return Parse{{genResponseTypeName $opid | ucFirst}}(rsp)
 }
 
 {{$hasParams := .RequiresParamObject -}}
@@ -349,7 +349,7 @@ func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Conte
     if err != nil {
         return nil, err
     }
-    return Parse{{genResponseTypeName $opid}}(rsp)
+    return Parse{{genResponseTypeName $opid | ucFirst}}(rsp)
 }
 {{end}}
 
@@ -358,8 +358,8 @@ func (c *ClientWithResponses) {{$opid}}{{.Suffix}}WithResponse(ctx context.Conte
 {{/* Generate parse functions for responses*/}}
 {{range .}}{{$opid := .OperationId}}
 
-// Parse{{genResponseTypeName $opid}} parses an HTTP response from a {{$opid}}WithResponse call
-func Parse{{genResponseTypeName $opid}}(rsp *http.Response) (*{{genResponseTypeName $opid}}, error) {
+// Parse{{genResponseTypeName $opid | ucFirst}} parses an HTTP response from a {{$opid}}WithResponse call
+func Parse{{genResponseTypeName $opid | ucFirst}}(rsp *http.Response) (*{{genResponseTypeName $opid}}, error) {
     bodyBytes, err := ioutil.ReadAll(rsp.Body)
     defer rsp.Body.Close()
     if err != nil {
diff --git a/pkg/codegen/utils.go b/pkg/codegen/utils.go
index b6e406d..2a35b03 100644
--- a/pkg/codegen/utils.go
+++ b/pkg/codegen/utils.go
@@ -15,14 +15,13 @@ package codegen
 
 import (
 	"fmt"
-
-	"github.com/getkin/kin-openapi/openapi3"
-	"github.com/pkg/errors"
-
 	"regexp"
 	"sort"
 	"strings"
 	"unicode"
+
+	"github.com/getkin/kin-openapi/openapi3"
+	"github.com/pkg/errors"
 )
 
 var pathParamRE *regexp.Regexp
@@ -57,25 +56,33 @@ func LowercaseFirstCharacter(str string) string {
 // So, "word.word-word+word:word;word_word~word word(word)word{word}[word]"
 // would be converted to WordWordWordWordWordWordWordWordWordWordWordWordWord
 func ToCamelCase(str string) string {
-	separators := []string{".", "-", "+", ":", ";", "_", "~", " ", "(", ")", "{", "}", "[", "]"}
-	in := []string{str}
-	out := make([]string, 0)
-
-	for _, sep := range separators {
-		for _, inStr := range in {
-			parts := strings.Split(inStr, sep)
-			out = append(out, parts...)
+	separators := "-#@!$&=.+:;_~ (){}[]"
+	s := strings.Trim(str, " ")
+
+	n := ""
+	capNext := true
+	for _, v := range s {
+		if unicode.IsUpper(v) {
+			n += string(v)
+		}
+			if unicode.IsDigit(v) {
+			n += string(v)
+		}
+		if unicode.IsLower(v) {
+			if capNext {
+				n += strings.ToUpper(string(v))
+			} else {
+				n += string(v)
+			}
 		}
-		in = out
-		out = make([]string, 0)
-	}
-
-	words := in
 
-	for i := range words {
-		words[i] = UppercaseFirstCharacter(words[i])
+		 if strings.ContainsRune(separators, v) {
+			capNext = true
+		} else {
+			capNext = false
+		}
 	}
-	return strings.Join(words, "")
+	return n
 }
 
 // This function returns the keys of the given SchemaRef dictionary in sorted
@@ -315,7 +322,7 @@ func IsGoKeyword(str string) bool {
 func SchemaNameToTypeName(name string) string {
 	name = ToCamelCase(name)
 	// Prepend "N" to schemas starting with a number
-	if unicode.IsDigit([]rune(name)[0]) {
+	if name != "" && unicode.IsDigit([]rune(name)[0]) {
 		name = "N" + name
 	}
 	return name


Test patch:
diff --git a/internal/test/client/client.gen.go b/internal/test/client/client.gen.go
index d042733..00a72ee 100644
--- a/internal/test/client/client.gen.go
+++ b/internal/test/client/client.gen.go
@@ -620,7 +620,7 @@ func (c *ClientWithResponses) PostBothWithBodyWithResponse(ctx context.Context,
 	if err != nil {
 		return nil, err
 	}
-	return ParsepostBothResponse(rsp)
+	return ParsePostBothResponse(rsp)
 }
 
 func (c *ClientWithResponses) PostBothWithResponse(ctx context.Context, body PostBothJSONRequestBody) (*postBothResponse, error) {
@@ -628,7 +628,7 @@ func (c *ClientWithResponses) PostBothWithResponse(ctx context.Context, body Pos
 	if err != nil {
 		return nil, err
 	}
-	return ParsepostBothResponse(rsp)
+	return ParsePostBothResponse(rsp)
 }
 
 // GetBothWithResponse request returning *GetBothResponse
@@ -637,7 +637,7 @@ func (c *ClientWithResponses) GetBothWithResponse(ctx context.Context) (*getBoth
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetBothResponse(rsp)
+	return ParseGetBothResponse(rsp)
 }
 
 // PostJsonWithBodyWithResponse request with arbitrary body returning *PostJsonResponse
@@ -646,7 +646,7 @@ func (c *ClientWithResponses) PostJsonWithBodyWithResponse(ctx context.Context,
 	if err != nil {
 		return nil, err
 	}
-	return ParsepostJsonResponse(rsp)
+	return ParsePostJsonResponse(rsp)
 }
 
 func (c *ClientWithResponses) PostJsonWithResponse(ctx context.Context, body PostJsonJSONRequestBody) (*postJsonResponse, error) {
@@ -654,7 +654,7 @@ func (c *ClientWithResponses) PostJsonWithResponse(ctx context.Context, body Pos
 	if err != nil {
 		return nil, err
 	}
-	return ParsepostJsonResponse(rsp)
+	return ParsePostJsonResponse(rsp)
 }
 
 // GetJsonWithResponse request returning *GetJsonResponse
@@ -663,7 +663,7 @@ func (c *ClientWithResponses) GetJsonWithResponse(ctx context.Context) (*getJson
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetJsonResponse(rsp)
+	return ParseGetJsonResponse(rsp)
 }
 
 // PostOtherWithBodyWithResponse request with arbitrary body returning *PostOtherResponse
@@ -672,7 +672,7 @@ func (c *ClientWithResponses) PostOtherWithBodyWithResponse(ctx context.Context,
 	if err != nil {
 		return nil, err
 	}
-	return ParsepostOtherResponse(rsp)
+	return ParsePostOtherResponse(rsp)
 }
 
 // GetOtherWithResponse request returning *GetOtherResponse
@@ -681,7 +681,7 @@ func (c *ClientWithResponses) GetOtherWithResponse(ctx context.Context) (*getOth
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetOtherResponse(rsp)
+	return ParseGetOtherResponse(rsp)
 }
 
 // GetJsonWithTrailingSlashWithResponse request returning *GetJsonWithTrailingSlashResponse
@@ -690,11 +690,11 @@ func (c *ClientWithResponses) GetJsonWithTrailingSlashWithResponse(ctx context.C
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetJsonWithTrailingSlashResponse(rsp)
+	return ParseGetJsonWithTrailingSlashResponse(rsp)
 }
 
-// ParsepostBothResponse parses an HTTP response from a PostBothWithResponse call
-func ParsepostBothResponse(rsp *http.Response) (*postBothResponse, error) {
+// ParsePostBothResponse parses an HTTP response from a PostBothWithResponse call
+func ParsePostBothResponse(rsp *http.Response) (*postBothResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -712,8 +712,8 @@ func ParsepostBothResponse(rsp *http.Response) (*postBothResponse, error) {
 	return response, nil
 }
 
-// ParsegetBothResponse parses an HTTP response from a GetBothWithResponse call
-func ParsegetBothResponse(rsp *http.Response) (*getBothResponse, error) {
+// ParseGetBothResponse parses an HTTP response from a GetBothWithResponse call
+func ParseGetBothResponse(rsp *http.Response) (*getBothResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -731,8 +731,8 @@ func ParsegetBothResponse(rsp *http.Response) (*getBothResponse, error) {
 	return response, nil
 }
 
-// ParsepostJsonResponse parses an HTTP response from a PostJsonWithResponse call
-func ParsepostJsonResponse(rsp *http.Response) (*postJsonResponse, error) {
+// ParsePostJsonResponse parses an HTTP response from a PostJsonWithResponse call
+func ParsePostJsonResponse(rsp *http.Response) (*postJsonResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -750,8 +750,8 @@ func ParsepostJsonResponse(rsp *http.Response) (*postJsonResponse, error) {
 	return response, nil
 }
 
-// ParsegetJsonResponse parses an HTTP response from a GetJsonWithResponse call
-func ParsegetJsonResponse(rsp *http.Response) (*getJsonResponse, error) {
+// ParseGetJsonResponse parses an HTTP response from a GetJsonWithResponse call
+func ParseGetJsonResponse(rsp *http.Response) (*getJsonResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -769,8 +769,8 @@ func ParsegetJsonResponse(rsp *http.Response) (*getJsonResponse, error) {
 	return response, nil
 }
 
-// ParsepostOtherResponse parses an HTTP response from a PostOtherWithResponse call
-func ParsepostOtherResponse(rsp *http.Response) (*postOtherResponse, error) {
+// ParsePostOtherResponse parses an HTTP response from a PostOtherWithResponse call
+func ParsePostOtherResponse(rsp *http.Response) (*postOtherResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -788,8 +788,8 @@ func ParsepostOtherResponse(rsp *http.Response) (*postOtherResponse, error) {
 	return response, nil
 }
 
-// ParsegetOtherResponse parses an HTTP response from a GetOtherWithResponse call
-func ParsegetOtherResponse(rsp *http.Response) (*getOtherResponse, error) {
+// ParseGetOtherResponse parses an HTTP response from a GetOtherWithResponse call
+func ParseGetOtherResponse(rsp *http.Response) (*getOtherResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -807,8 +807,8 @@ func ParsegetOtherResponse(rsp *http.Response) (*getOtherResponse, error) {
 	return response, nil
 }
 
-// ParsegetJsonWithTrailingSlashResponse parses an HTTP response from a GetJsonWithTrailingSlashWithResponse call
-func ParsegetJsonWithTrailingSlashResponse(rsp *http.Response) (*getJsonWithTrailingSlashResponse, error) {
+// ParseGetJsonWithTrailingSlashResponse parses an HTTP response from a GetJsonWithTrailingSlashWithResponse call
+func ParseGetJsonWithTrailingSlashResponse(rsp *http.Response) (*getJsonWithTrailingSlashResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
diff --git a/internal/test/components/components.gen.go b/internal/test/components/components.gen.go
index 1a85d2e..618c6fb 100644
--- a/internal/test/components/components.gen.go
+++ b/internal/test/components/components.gen.go
@@ -1000,7 +1000,7 @@ func (c *ClientWithResponses) ParamsWithAddPropsWithResponse(ctx context.Context
 	if err != nil {
 		return nil, err
 	}
-	return ParseparamsWithAddPropsResponse(rsp)
+	return ParseParamsWithAddPropsResponse(rsp)
 }
 
 // BodyWithAddPropsWithBodyWithResponse request with arbitrary body returning *BodyWithAddPropsResponse
@@ -1009,7 +1009,7 @@ func (c *ClientWithResponses) BodyWithAddPropsWithBodyWithResponse(ctx context.C
 	if err != nil {
 		return nil, err
 	}
-	return ParsebodyWithAddPropsResponse(rsp)
+	return ParseBodyWithAddPropsResponse(rsp)
 }
 
 func (c *ClientWithResponses) BodyWithAddPropsWithResponse(ctx context.Context, body BodyWithAddPropsJSONRequestBody) (*bodyWithAddPropsResponse, error) {
@@ -1017,11 +1017,11 @@ func (c *ClientWithResponses) BodyWithAddPropsWithResponse(ctx context.Context,
 	if err != nil {
 		return nil, err
 	}
-	return ParsebodyWithAddPropsResponse(rsp)
+	return ParseBodyWithAddPropsResponse(rsp)
 }
 
-// ParseparamsWithAddPropsResponse parses an HTTP response from a ParamsWithAddPropsWithResponse call
-func ParseparamsWithAddPropsResponse(rsp *http.Response) (*paramsWithAddPropsResponse, error) {
+// ParseParamsWithAddPropsResponse parses an HTTP response from a ParamsWithAddPropsWithResponse call
+func ParseParamsWithAddPropsResponse(rsp *http.Response) (*paramsWithAddPropsResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1039,8 +1039,8 @@ func ParseparamsWithAddPropsResponse(rsp *http.Response) (*paramsWithAddPropsRes
 	return response, nil
 }
 
-// ParsebodyWithAddPropsResponse parses an HTTP response from a BodyWithAddPropsWithResponse call
-func ParsebodyWithAddPropsResponse(rsp *http.Response) (*bodyWithAddPropsResponse, error) {
+// ParseBodyWithAddPropsResponse parses an HTTP response from a BodyWithAddPropsWithResponse call
+func ParseBodyWithAddPropsResponse(rsp *http.Response) (*bodyWithAddPropsResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
diff --git a/internal/test/issues/issue-52/issue.gen.go b/internal/test/issues/issue-52/issue.gen.go
index 86ec4cb..6df59c3 100644
--- a/internal/test/issues/issue-52/issue.gen.go
+++ b/internal/test/issues/issue-52/issue.gen.go
@@ -256,11 +256,11 @@ func (c *ClientWithResponses) ExampleGetWithResponse(ctx context.Context) (*exam
 	if err != nil {
 		return nil, err
 	}
-	return ParseexampleGetResponse(rsp)
+	return ParseExampleGetResponse(rsp)
 }
 
-// ParseexampleGetResponse parses an HTTP response from a ExampleGetWithResponse call
-func ParseexampleGetResponse(rsp *http.Response) (*exampleGetResponse, error) {
+// ParseExampleGetResponse parses an HTTP response from a ExampleGetWithResponse call
+func ParseExampleGetResponse(rsp *http.Response) (*exampleGetResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -328,12 +328,12 @@ func RegisterHandlers(router interface {
 // Base64 encoded, gzipped, json marshaled Swagger object
 var swaggerSpec = []string{
 
-	"H4sIAAAAAAAC/5RST0v8MBD9KmV+v2No63rrTRBERPTkycuYzG6zpklIpovL0u8uk+5fFMVTkse8N29e",
-	"Zgc6DDF48pyh20HWPQ1Yrjcp4fYF3UjyskxDgf8nWkIH/5oTsdmzmrl6UsDbSNABioS8b4MeB/IsAjGF",
-	"SIktFbmlJWfKDY2xbINH93xR8ZeG4W1NmmH6iig4jnJpAC/G/KnZWSCTgszJ+tWRuG83o98ZEMj6ZZBi",
-	"QznrZKOMCx084jtVeUxUcY9cJdJjynZDlUjkChNVPXrjyFSzd7d99aCALTtpQR84REegYEMpz5pt3dZX",
-	"4jNE8hgtdHBdt/UCFETkvozeHIjdDlZUPkfUUWzdm5PwHTEoSJRj8HlObdG2cujgef+tGKOzunCbdRYP",
-	"h236LdfjcpSMDJ1H8/Qg6DRNnwEAAP//F7YifqkCAAA=",
+	"H4sIAAAAAAAC/5RSQU/zMAz9K5W/71i1ZdxyQwIhhBCcOHExibdmpEmUuBPT1P+OnG5jEwjEqcmr3/Pz",
+	"i3egwxCDJ88Z1A6y7mnAcrxKCbfP6EaSm2UaCvw/0RIU/Gs/ie2e1c7VUw28jQQKUCTkfh30OJBnEYgp",
+	"REpsqcgtLTlTTmiMZRs8uqezir80DK9r0gzTV6SG4yjnBvBszJ+anQQy1ZA5Wb86EvftZvQ7AwJZvwxS",
+	"bChnnWyUcUHBA75RlcdEFffIVSI9pmw3VIlErjBR1aM3jkw1e3fbFw81sGUnLegdh+gIathQyrNm13TN",
+	"hfgMkTxGCwoum65ZQA0RuS+jtwei2sGKyuOIOoqtOwMKbub/t8RQQ6Icg89zaouuk48OnvfPijE6qwu3",
+	"XWfxcNim33I9LkfJyNBpNI/3gk7T9BEAAP//t/QkwqkCAAA=",
 }
 
 // GetSwagger returns the Swagger specification corresponding to the generated code
diff --git a/internal/test/parameters/parameters.gen.go b/internal/test/parameters/parameters.gen.go
index f9fb9f5..f1845be 100644
--- a/internal/test/parameters/parameters.gen.go
+++ b/internal/test/parameters/parameters.gen.go
@@ -1690,7 +1690,7 @@ func (c *ClientWithResponses) GetContentObjectWithResponse(ctx context.Context,
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetContentObjectResponse(rsp)
+	return ParseGetContentObjectResponse(rsp)
 }
 
 // GetCookieWithResponse request returning *GetCookieResponse
@@ -1699,7 +1699,7 @@ func (c *ClientWithResponses) GetCookieWithResponse(ctx context.Context, params
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetCookieResponse(rsp)
+	return ParseGetCookieResponse(rsp)
 }
 
 // GetHeaderWithResponse request returning *GetHeaderResponse
@@ -1708,7 +1708,7 @@ func (c *ClientWithResponses) GetHeaderWithResponse(ctx context.Context, params
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetHeaderResponse(rsp)
+	return ParseGetHeaderResponse(rsp)
 }
 
 // GetLabelExplodeArrayWithResponse request returning *GetLabelExplodeArrayResponse
@@ -1717,7 +1717,7 @@ func (c *ClientWithResponses) GetLabelExplodeArrayWithResponse(ctx context.Conte
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetLabelExplodeArrayResponse(rsp)
+	return ParseGetLabelExplodeArrayResponse(rsp)
 }
 
 // GetLabelExplodeObjectWithResponse request returning *GetLabelExplodeObjectResponse
@@ -1726,7 +1726,7 @@ func (c *ClientWithResponses) GetLabelExplodeObjectWithResponse(ctx context.Cont
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetLabelExplodeObjectResponse(rsp)
+	return ParseGetLabelExplodeObjectResponse(rsp)
 }
 
 // GetLabelNoExplodeArrayWithResponse request returning *GetLabelNoExplodeArrayResponse
@@ -1735,7 +1735,7 @@ func (c *ClientWithResponses) GetLabelNoExplodeArrayWithResponse(ctx context.Con
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetLabelNoExplodeArrayResponse(rsp)
+	return ParseGetLabelNoExplodeArrayResponse(rsp)
 }
 
 // GetLabelNoExplodeObjectWithResponse request returning *GetLabelNoExplodeObjectResponse
@@ -1744,7 +1744,7 @@ func (c *ClientWithResponses) GetLabelNoExplodeObjectWithResponse(ctx context.Co
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetLabelNoExplodeObjectResponse(rsp)
+	return ParseGetLabelNoExplodeObjectResponse(rsp)
 }
 
 // GetMatrixExplodeArrayWithResponse request returning *GetMatrixExplodeArrayResponse
@@ -1753,7 +1753,7 @@ func (c *ClientWithResponses) GetMatrixExplodeArrayWithResponse(ctx context.Cont
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetMatrixExplodeArrayResponse(rsp)
+	return ParseGetMatrixExplodeArrayResponse(rsp)
 }
 
 // GetMatrixExplodeObjectWithResponse request returning *GetMatrixExplodeObjectResponse
@@ -1762,7 +1762,7 @@ func (c *ClientWithResponses) GetMatrixExplodeObjectWithResponse(ctx context.Con
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetMatrixExplodeObjectResponse(rsp)
+	return ParseGetMatrixExplodeObjectResponse(rsp)
 }
 
 // GetMatrixNoExplodeArrayWithResponse request returning *GetMatrixNoExplodeArrayResponse
@@ -1771,7 +1771,7 @@ func (c *ClientWithResponses) GetMatrixNoExplodeArrayWithResponse(ctx context.Co
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetMatrixNoExplodeArrayResponse(rsp)
+	return ParseGetMatrixNoExplodeArrayResponse(rsp)
 }
 
 // GetMatrixNoExplodeObjectWithResponse request returning *GetMatrixNoExplodeObjectResponse
@@ -1780,7 +1780,7 @@ func (c *ClientWithResponses) GetMatrixNoExplodeObjectWithResponse(ctx context.C
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetMatrixNoExplodeObjectResponse(rsp)
+	return ParseGetMatrixNoExplodeObjectResponse(rsp)
 }
 
 // GetPassThroughWithResponse request returning *GetPassThroughResponse
@@ -1789,7 +1789,7 @@ func (c *ClientWithResponses) GetPassThroughWithResponse(ctx context.Context, pa
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetPassThroughResponse(rsp)
+	return ParseGetPassThroughResponse(rsp)
 }
 
 // GetQueryFormWithResponse request returning *GetQueryFormResponse
@@ -1798,7 +1798,7 @@ func (c *ClientWithResponses) GetQueryFormWithResponse(ctx context.Context, para
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetQueryFormResponse(rsp)
+	return ParseGetQueryFormResponse(rsp)
 }
 
 // GetSimpleExplodeArrayWithResponse request returning *GetSimpleExplodeArrayResponse
@@ -1807,7 +1807,7 @@ func (c *ClientWithResponses) GetSimpleExplodeArrayWithResponse(ctx context.Cont
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetSimpleExplodeArrayResponse(rsp)
+	return ParseGetSimpleExplodeArrayResponse(rsp)
 }
 
 // GetSimpleExplodeObjectWithResponse request returning *GetSimpleExplodeObjectResponse
@@ -1816,7 +1816,7 @@ func (c *ClientWithResponses) GetSimpleExplodeObjectWithResponse(ctx context.Con
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetSimpleExplodeObjectResponse(rsp)
+	return ParseGetSimpleExplodeObjectResponse(rsp)
 }
 
 // GetSimpleNoExplodeArrayWithResponse request returning *GetSimpleNoExplodeArrayResponse
@@ -1825,7 +1825,7 @@ func (c *ClientWithResponses) GetSimpleNoExplodeArrayWithResponse(ctx context.Co
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetSimpleNoExplodeArrayResponse(rsp)
+	return ParseGetSimpleNoExplodeArrayResponse(rsp)
 }
 
 // GetSimpleNoExplodeObjectWithResponse request returning *GetSimpleNoExplodeObjectResponse
@@ -1834,7 +1834,7 @@ func (c *ClientWithResponses) GetSimpleNoExplodeObjectWithResponse(ctx context.C
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetSimpleNoExplodeObjectResponse(rsp)
+	return ParseGetSimpleNoExplodeObjectResponse(rsp)
 }
 
 // GetSimplePrimitiveWithResponse request returning *GetSimplePrimitiveResponse
@@ -1843,11 +1843,11 @@ func (c *ClientWithResponses) GetSimplePrimitiveWithResponse(ctx context.Context
 	if err != nil {
 		return nil, err
 	}
-	return ParsegetSimplePrimitiveResponse(rsp)
+	return ParseGetSimplePrimitiveResponse(rsp)
 }
 
-// ParsegetContentObjectResponse parses an HTTP response from a GetContentObjectWithResponse call
-func ParsegetContentObjectResponse(rsp *http.Response) (*getContentObjectResponse, error) {
+// ParseGetContentObjectResponse parses an HTTP response from a GetContentObjectWithResponse call
+func ParseGetContentObjectResponse(rsp *http.Response) (*getContentObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1865,8 +1865,8 @@ func ParsegetContentObjectResponse(rsp *http.Response) (*getContentObjectRespons
 	return response, nil
 }
 
-// ParsegetCookieResponse parses an HTTP response from a GetCookieWithResponse call
-func ParsegetCookieResponse(rsp *http.Response) (*getCookieResponse, error) {
+// ParseGetCookieResponse parses an HTTP response from a GetCookieWithResponse call
+func ParseGetCookieResponse(rsp *http.Response) (*getCookieResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1884,8 +1884,8 @@ func ParsegetCookieResponse(rsp *http.Response) (*getCookieResponse, error) {
 	return response, nil
 }
 
-// ParsegetHeaderResponse parses an HTTP response from a GetHeaderWithResponse call
-func ParsegetHeaderResponse(rsp *http.Response) (*getHeaderResponse, error) {
+// ParseGetHeaderResponse parses an HTTP response from a GetHeaderWithResponse call
+func ParseGetHeaderResponse(rsp *http.Response) (*getHeaderResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1903,8 +1903,8 @@ func ParsegetHeaderResponse(rsp *http.Response) (*getHeaderResponse, error) {
 	return response, nil
 }
 
-// ParsegetLabelExplodeArrayResponse parses an HTTP response from a GetLabelExplodeArrayWithResponse call
-func ParsegetLabelExplodeArrayResponse(rsp *http.Response) (*getLabelExplodeArrayResponse, error) {
+// ParseGetLabelExplodeArrayResponse parses an HTTP response from a GetLabelExplodeArrayWithResponse call
+func ParseGetLabelExplodeArrayResponse(rsp *http.Response) (*getLabelExplodeArrayResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1922,8 +1922,8 @@ func ParsegetLabelExplodeArrayResponse(rsp *http.Response) (*getLabelExplodeArra
 	return response, nil
 }
 
-// ParsegetLabelExplodeObjectResponse parses an HTTP response from a GetLabelExplodeObjectWithResponse call
-func ParsegetLabelExplodeObjectResponse(rsp *http.Response) (*getLabelExplodeObjectResponse, error) {
+// ParseGetLabelExplodeObjectResponse parses an HTTP response from a GetLabelExplodeObjectWithResponse call
+func ParseGetLabelExplodeObjectResponse(rsp *http.Response) (*getLabelExplodeObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1941,8 +1941,8 @@ func ParsegetLabelExplodeObjectResponse(rsp *http.Response) (*getLabelExplodeObj
 	return response, nil
 }
 
-// ParsegetLabelNoExplodeArrayResponse parses an HTTP response from a GetLabelNoExplodeArrayWithResponse call
-func ParsegetLabelNoExplodeArrayResponse(rsp *http.Response) (*getLabelNoExplodeArrayResponse, error) {
+// ParseGetLabelNoExplodeArrayResponse parses an HTTP response from a GetLabelNoExplodeArrayWithResponse call
+func ParseGetLabelNoExplodeArrayResponse(rsp *http.Response) (*getLabelNoExplodeArrayResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1960,8 +1960,8 @@ func ParsegetLabelNoExplodeArrayResponse(rsp *http.Response) (*getLabelNoExplode
 	return response, nil
 }
 
-// ParsegetLabelNoExplodeObjectResponse parses an HTTP response from a GetLabelNoExplodeObjectWithResponse call
-func ParsegetLabelNoExplodeObjectResponse(rsp *http.Response) (*getLabelNoExplodeObjectResponse, error) {
+// ParseGetLabelNoExplodeObjectResponse parses an HTTP response from a GetLabelNoExplodeObjectWithResponse call
+func ParseGetLabelNoExplodeObjectResponse(rsp *http.Response) (*getLabelNoExplodeObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1979,8 +1979,8 @@ func ParsegetLabelNoExplodeObjectResponse(rsp *http.Response) (*getLabelNoExplod
 	return response, nil
 }
 
-// ParsegetMatrixExplodeArrayResponse parses an HTTP response from a GetMatrixExplodeArrayWithResponse call
-func ParsegetMatrixExplodeArrayResponse(rsp *http.Response) (*getMatrixExplodeArrayResponse, error) {
+// ParseGetMatrixExplodeArrayResponse parses an HTTP response from a GetMatrixExplodeArrayWithResponse call
+func ParseGetMatrixExplodeArrayResponse(rsp *http.Response) (*getMatrixExplodeArrayResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -1998,8 +1998,8 @@ func ParsegetMatrixExplodeArrayResponse(rsp *http.Response) (*getMatrixExplodeAr
 	return response, nil
 }
 
-// ParsegetMatrixExplodeObjectResponse parses an HTTP response from a GetMatrixExplodeObjectWithResponse call
-func ParsegetMatrixExplodeObjectResponse(rsp *http.Response) (*getMatrixExplodeObjectResponse, error) {
+// ParseGetMatrixExplodeObjectResponse parses an HTTP response from a GetMatrixExplodeObjectWithResponse call
+func ParseGetMatrixExplodeObjectResponse(rsp *http.Response) (*getMatrixExplodeObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2017,8 +2017,8 @@ func ParsegetMatrixExplodeObjectResponse(rsp *http.Response) (*getMatrixExplodeO
 	return response, nil
 }
 
-// ParsegetMatrixNoExplodeArrayResponse parses an HTTP response from a GetMatrixNoExplodeArrayWithResponse call
-func ParsegetMatrixNoExplodeArrayResponse(rsp *http.Response) (*getMatrixNoExplodeArrayResponse, error) {
+// ParseGetMatrixNoExplodeArrayResponse parses an HTTP response from a GetMatrixNoExplodeArrayWithResponse call
+func ParseGetMatrixNoExplodeArrayResponse(rsp *http.Response) (*getMatrixNoExplodeArrayResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2036,8 +2036,8 @@ func ParsegetMatrixNoExplodeArrayResponse(rsp *http.Response) (*getMatrixNoExplo
 	return response, nil
 }
 
-// ParsegetMatrixNoExplodeObjectResponse parses an HTTP response from a GetMatrixNoExplodeObjectWithResponse call
-func ParsegetMatrixNoExplodeObjectResponse(rsp *http.Response) (*getMatrixNoExplodeObjectResponse, error) {
+// ParseGetMatrixNoExplodeObjectResponse parses an HTTP response from a GetMatrixNoExplodeObjectWithResponse call
+func ParseGetMatrixNoExplodeObjectResponse(rsp *http.Response) (*getMatrixNoExplodeObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2055,8 +2055,8 @@ func ParsegetMatrixNoExplodeObjectResponse(rsp *http.Response) (*getMatrixNoExpl
 	return response, nil
 }
 
-// ParsegetPassThroughResponse parses an HTTP response from a GetPassThroughWithResponse call
-func ParsegetPassThroughResponse(rsp *http.Response) (*getPassThroughResponse, error) {
+// ParseGetPassThroughResponse parses an HTTP response from a GetPassThroughWithResponse call
+func ParseGetPassThroughResponse(rsp *http.Response) (*getPassThroughResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2074,8 +2074,8 @@ func ParsegetPassThroughResponse(rsp *http.Response) (*getPassThroughResponse, e
 	return response, nil
 }
 
-// ParsegetQueryFormResponse parses an HTTP response from a GetQueryFormWithResponse call
-func ParsegetQueryFormResponse(rsp *http.Response) (*getQueryFormResponse, error) {
+// ParseGetQueryFormResponse parses an HTTP response from a GetQueryFormWithResponse call
+func ParseGetQueryFormResponse(rsp *http.Response) (*getQueryFormResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2093,8 +2093,8 @@ func ParsegetQueryFormResponse(rsp *http.Response) (*getQueryFormResponse, error
 	return response, nil
 }
 
-// ParsegetSimpleExplodeArrayResponse parses an HTTP response from a GetSimpleExplodeArrayWithResponse call
-func ParsegetSimpleExplodeArrayResponse(rsp *http.Response) (*getSimpleExplodeArrayResponse, error) {
+// ParseGetSimpleExplodeArrayResponse parses an HTTP response from a GetSimpleExplodeArrayWithResponse call
+func ParseGetSimpleExplodeArrayResponse(rsp *http.Response) (*getSimpleExplodeArrayResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2112,8 +2112,8 @@ func ParsegetSimpleExplodeArrayResponse(rsp *http.Response) (*getSimpleExplodeAr
 	return response, nil
 }
 
-// ParsegetSimpleExplodeObjectResponse parses an HTTP response from a GetSimpleExplodeObjectWithResponse call
-func ParsegetSimpleExplodeObjectResponse(rsp *http.Response) (*getSimpleExplodeObjectResponse, error) {
+// ParseGetSimpleExplodeObjectResponse parses an HTTP response from a GetSimpleExplodeObjectWithResponse call
+func ParseGetSimpleExplodeObjectResponse(rsp *http.Response) (*getSimpleExplodeObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2131,8 +2131,8 @@ func ParsegetSimpleExplodeObjectResponse(rsp *http.Response) (*getSimpleExplodeO
 	return response, nil
 }
 
-// ParsegetSimpleNoExplodeArrayResponse parses an HTTP response from a GetSimpleNoExplodeArrayWithResponse call
-func ParsegetSimpleNoExplodeArrayResponse(rsp *http.Response) (*getSimpleNoExplodeArrayResponse, error) {
+// ParseGetSimpleNoExplodeArrayResponse parses an HTTP response from a GetSimpleNoExplodeArrayWithResponse call
+func ParseGetSimpleNoExplodeArrayResponse(rsp *http.Response) (*getSimpleNoExplodeArrayResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2150,8 +2150,8 @@ func ParsegetSimpleNoExplodeArrayResponse(rsp *http.Response) (*getSimpleNoExplo
 	return response, nil
 }
 
-// ParsegetSimpleNoExplodeObjectResponse parses an HTTP response from a GetSimpleNoExplodeObjectWithResponse call
-func ParsegetSimpleNoExplodeObjectResponse(rsp *http.Response) (*getSimpleNoExplodeObjectResponse, error) {
+// ParseGetSimpleNoExplodeObjectResponse parses an HTTP response from a GetSimpleNoExplodeObjectWithResponse call
+func ParseGetSimpleNoExplodeObjectResponse(rsp *http.Response) (*getSimpleNoExplodeObjectResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2169,8 +2169,8 @@ func ParsegetSimpleNoExplodeObjectResponse(rsp *http.Response) (*getSimpleNoExpl
 	return response, nil
 }
 
-// ParsegetSimplePrimitiveResponse parses an HTTP response from a GetSimplePrimitiveWithResponse call
-func ParsegetSimplePrimitiveResponse(rsp *http.Response) (*getSimplePrimitiveResponse, error) {
+// ParseGetSimplePrimitiveResponse parses an HTTP response from a GetSimplePrimitiveWithResponse call
+func ParseGetSimplePrimitiveResponse(rsp *http.Response) (*getSimplePrimitiveResponse, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -2807,23 +2807,23 @@ func RegisterHandlers(router interface {
 // Base64 encoded, gzipped, json marshaled Swagger object
 var swaggerSpec = []string{
 
-	"H4sIAAAAAAAC/9xZy27rNhD9FWPaVaFr+d670y4IWjRA82idRYHAC0Ya20wlkSHpwIahfy9IPWw9LFOJ",
-	"LDvZxdI8zhweTcjhFnwWcRZjrCR4WxAoOYslmh9TGvEQ/8ke6Sc+ixXGSv+pcK1cHhIa61/SX2JEzPMN",
-	"R/BAKkHjBSRJ4kCA0heUK8pi8OBqJE3cUZ5rxJ5f0FegTdM4Jvs101br+/SltwUuGEehaAruJmjI5sDO",
-	"/FeBc/DgF3dXoZuFd+93GQW+rqjAALyn3NnRwWelYOXccyqkuiMRNkIQLGx6UcllrJy9UDPDFY3nTDuH",
-	"1MeM9NgkgtubRx1dUaXDwyNKNZqieEMBDryhkCm938eT8UQbMo4x4RQ8+DmejL+DA5yopcHvZuuY1udu",
-	"OREkSvSbBZpydbFEr5dmWT+83ncwoQSJUKGQ4D2VdEE4D6lvnN0XySrqaFuU8oJnbIBnYIOT02Aywz6X",
-	"SqwwmTll7f6YTA7lK+zcisATk9P1GfuPYjsbxqJGQ1noXNCIKvqmDXHNQxYgeHMSSswK8/MweWmlsjLL",
-	"HXdzJiKiwAMaq58/wMkFRmOFCxRaYVYQNF8HEGD/ELK0wYgIQTa2OEg7DqowklaAiidp+gaANVxtSzQg",
-	"roI4ln90VsyxdoR2XbG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oCHHhFIVN6v44n44k2ZBxjwil48H08GX8FBzhRS4PfzdYxrc/d",
+	"ciJIlOg3CzTl6mKJXi/NMvyJ6mrfwYQSJEKFQoL3WNIF4TykvnF2nyWrqKNtUcoLnrEBnoENTk6DyQz7",
+	"XCqxwmTmlLX7bTI5lK+wcysCT0xO12fsf4rtbBiLGg1loXNBI6roqzbENQ9ZgODNSSgxK8zPw+SllcrK",
+	"LHfczZmIiAIPaKy+fwMnFxiNFS5QaIVZQdB8HUCA/UPI0gYjIgTZ2OIg7TiowkhaASqepOkbANZwtS3R",
+	"gLgK4lj+0Vkxx9oR2nXFKpY6hDaSeoJwqqZSLs1PDXYsN5bkN9SUzEy7WCIJULS1i79Si/e2i2UeJsP0",
+	"35f7PZdhG0cLli+/Z8I9TyupI/uhrS1RDdZYDsC8tPZSh5l+SZZ0nqLbHIL08ZtOvbIs0MEKsxYUkicM",
+	"sxUxMnK3Y9Nrfmvd1P1ddau3qCZN2OzH+lGtA1JtzG7XVAg97fIckKsoImIDXrwKwxqF+ba4K4eHdsd9",
+	"kGij36HpumVNmjtOV9mvha/9z/7zqq6go6y7DjweFd57iLww5UVECbquCI8G7V/pTc3pLV8pDU6uuLS6",
+	"wfgrFNeJwLf3uSMMdpPaUFzV2hwNLLjqocl9Ir3Ve1w3Et/R4T6Y5jiR8mEp2GqxtBnM3e/MW8dyHca1",
+	"Zxm6vaxQbP5gImor9p/C6MhZ2uqkaFIOMXPayUe7QseTYgXm+VDanRirrJ5hHlWBcBIEBRnHJiVVPgYa",
+	"8rbw0QeCcx6TK+U0j+b660zpbVV5C2BxMJzW3C73dJ2WeMr/aiUSS9dOHVi8nPP1UIRVt57H9wPTBr8L",
+	"PmEPTqT9lee0yfEizthDkVaM9O3p2r+RqBD1JmIspHUaVkzvl+Z6PYW/EiF4sFSKe66b3a0rlGocIPKI",
+	"8DGhkMySnwEAAP//njtWvlEhAAA=",
 }
 
 // GetSwagger returns the Swagger specification corresponding to the generated code
diff --git a/internal/test/schemas/schemas.gen.go b/internal/test/schemas/schemas.gen.go
index 2403d7b..c17f9b8 100644
--- a/internal/test/schemas/schemas.gen.go
+++ b/internal/test/schemas/schemas.gen.go
@@ -389,7 +389,7 @@ func (c *ClientWithResponses) Issue30WithResponse(ctx context.Context, pFallthro
 	if err != nil {
 		return nil, err
 	}
-	return Parseissue30Response(rsp)
+	return ParseIssue30Response(rsp)
 }
 
 // Issue41WithResponse request returning *Issue41Response
@@ -398,7 +398,7 @@ func (c *ClientWithResponses) Issue41WithResponse(ctx context.Context, n1param N
 	if err != nil {
 		return nil, err
 	}
-	return Parseissue41Response(rsp)
+	return ParseIssue41Response(rsp)
 }
 
 // Issue9WithBodyWithResponse request with arbitrary body returning *Issue9Response
@@ -407,7 +407,7 @@ func (c *ClientWithResponses) Issue9WithBodyWithResponse(ctx context.Context, pa
 	if err != nil {
 		return nil, err
 	}
-	return Parseissue9Response(rsp)
+	return ParseIssue9Response(rsp)
 }
 
 func (c *ClientWithResponses) Issue9WithResponse(ctx context.Context, params *Issue9Params, body Issue9JSONRequestBody) (*issue9Response, error) {
@@ -415,11 +415,11 @@ func (c *ClientWithResponses) Issue9WithResponse(ctx context.Context, params *Is
 	if err != nil {
 		return nil, err
 	}
-	return Parseissue9Response(rsp)
+	return ParseIssue9Response(rsp)
 }
 
-// Parseissue30Response parses an HTTP response from a Issue30WithResponse call
-func Parseissue30Response(rsp *http.Response) (*issue30Response, error) {
+// ParseIssue30Response parses an HTTP response from a Issue30WithResponse call
+func ParseIssue30Response(rsp *http.Response) (*issue30Response, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -437,8 +437,8 @@ func Parseissue30Response(rsp *http.Response) (*issue30Response, error) {
 	return response, nil
 }
 
-// Parseissue41Response parses an HTTP response from a Issue41WithResponse call
-func Parseissue41Response(rsp *http.Response) (*issue41Response, error) {
+// ParseIssue41Response parses an HTTP response from a Issue41WithResponse call
+func ParseIssue41Response(rsp *http.Response) (*issue41Response, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
@@ -456,8 +456,8 @@ func Parseissue41Response(rsp *http.Response) (*issue41Response, error) {
 	return response, nil
 }
 
-// Parseissue9Response parses an HTTP response from a Issue9WithResponse call
-func Parseissue9Response(rsp *http.Response) (*issue9Response, error) {
+// ParseIssue9Response parses an HTTP response from a Issue9WithResponse call
+func ParseIssue9Response(rsp *http.Response) (*issue9Response, error) {
 	bodyBytes, err := ioutil.ReadAll(rsp.Body)
 	defer rsp.Body.Close()
 	if err != nil {
diff --git a/internal/test/server/server.gen.go b/internal/test/server/server.gen.go
index 32f5d35..aa5d882 100644
--- a/internal/test/server/server.gen.go
+++ b/internal/test/server/server.gen.go
@@ -97,11 +97,11 @@ type GetWithArgsParams struct {
 	HeaderArgument *int32 `json:"header_argument,omitempty"`
 }
 
-// createResourceJSONBody defines parameters for CreateResource.
-type createResourceJSONBody EveryTypeRequired
+// CreateResourceJSONBody defines parameters for CreateResource.
+type CreateResourceJSONBody EveryTypeRequired
 
-// createResource2JSONBody defines parameters for CreateResource2.
-type createResource2JSONBody Resource
+// CreateResource2JSONBody defines parameters for CreateResource2.
+type CreateResource2JSONBody Resource
 
 // CreateResource2Params defines parameters for CreateResource2.
 type CreateResource2Params struct {
@@ -110,20 +110,20 @@ type CreateResource2Params struct {
 	InlineQueryArgument *int `json:"inline_query_argument,omitempty"`
 }
 
-// updateResource3JSONBody defines parameters for UpdateResource3.
-type updateResource3JSONBody struct {
+// UpdateResource3JSONBody defines parameters for UpdateResource3.
+type UpdateResource3JSONBody struct {
 	Id   *int    `json:"id,omitempty"`
 	Name *string `json:"name,omitempty"`
 }
 
 // CreateResourceRequestBody defines body for CreateResource for application/json ContentType.
-type CreateResourceJSONRequestBody createResourceJSONBody
+type CreateResourceJSONRequestBody CreateResourceJSONBody
 
 // CreateResource2RequestBody defines body for CreateResource2 for application/json ContentType.
-type CreateResource2JSONRequestBody createResource2JSONBody
+type CreateResource2JSONRequestBody CreateResource2JSONBody
 
 // UpdateResource3RequestBody defines body for UpdateResource3 for application/json ContentType.
-type UpdateResource3JSONRequestBody updateResource3JSONBody
+type UpdateResource3JSONRequestBody UpdateResource3JSONBody
 
 type ServerInterface interface {
 	// Get resource via simple path (GET /get-simple)
diff --git a/pkg/codegen/codegen_test.go b/pkg/codegen/codegen_test.go
index 13c1150..0150471 100644
--- a/pkg/codegen/codegen_test.go
+++ b/pkg/codegen/codegen_test.go
@@ -62,7 +62,7 @@ func TestExamplePetStoreParseFunction(t *testing.T) {
 	}
 	cannedResponse.Header.Add("Content-type", "application/json")
 
-	findPetByIDResponse, err := examplePetstoreClient.ParsefindPetByIdResponse(cannedResponse)
+	findPetByIDResponse, err := examplePetstoreClient.ParseFindPetByIdResponse(cannedResponse)
 	assert.NoError(t, err)
 	assert.NotNil(t, findPetByIDResponse.JSON200)
 	assert.Equal(t, int64(5), findPetByIDResponse.JSON200.Id)
@@ -162,11 +162,13 @@ type getTestByNameResponse struct {
 	// Check that the helper methods are generated correctly:
 	assert.Contains(t, code, "func (r getTestByNameResponse) Status() string {")
 	assert.Contains(t, code, "func (r getTestByNameResponse) StatusCode() int {")
-	assert.Contains(t, code, "func ParsegetTestByNameResponse(rsp *http.Response) (*getTestByNameResponse, error) {")
+	assert.Contains(t, code, "func ParseGetTestByNameResponse(rsp *http.Response) (*getTestByNameResponse, error) {")
 
 	// Check the client method signatures:
-	assert.Contains(t, code, "func (c *Client) GetTestByName(ctx context.Context, name string) (*http.Response, error) {")
-	assert.Contains(t, code, "func (c *ClientWithResponses) GetTestByNameWithResponse(ctx context.Context, name string) (*getTestByNameResponse, error) {")
+	assert.Contains(t, code, "type GetTestByNameParams struct {")
+	assert.Contains(t, code, "Top *int `json:\"$top,omitempty\"`")
+	assert.Contains(t, code, "func (c *Client) GetTestByName(ctx context.Context, name string, params *GetTestByNameParams) (*http.Response, error) {")
+	assert.Contains(t, code, "func (c *ClientWithResponses) GetTestByNameWithResponse(ctx context.Context, name string, params *GetTestByNameParams) (*getTestByNameResponse, error) {")
 
 	// Make sure the generated code is valid:
 	linter := new(lint.Linter)
@@ -200,6 +202,11 @@ paths:
         required: true
         schema:
           type: string
+      - name: $top
+        in: query
+        required: false
+        schema:
+          type: integer
       responses:
         200:
           description: Success