Skip to content

OpenAPI escaped strings are not escaped in Go #1529

@TotallyGamerJet

Description

@TotallyGamerJet

I generated a Jellyfin client for the stable jellyfin spec with the following command:
oapi-codegen -package jellyfin -generate types,client jellyfin-openapi-stable.json > jellyfin_api.go

However, oapi-codegen stopped during formatting of the code with the message:

./jellyfin_api.go:105172:68: expected ':', found CamelCase (and 10 more errors)

The offending code looks like this:

case rsp.Header.Get("Content-Type") == "application/json; profile="CamelCase"" && rsp.StatusCode == 200:
  var dest BaseItemDtoQueryResult
  if err := json.Unmarshal(bodyBytes, &dest); err != nil {
	  return nil, err
  }
  response.ApplicationjsonProfileCamelCase200 = &dest

As you can see the content type string was not escaped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions