We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a path parameter is a oneOf the whole oneOf is serialized and not one of the set values.
This is caused by the parameterToString method which serializes the struct to a string
parameterToString
func parameterToString(obj interface{}, collectionFormat string) string { var delimiter string switch collectionFormat { case "pipes": delimiter = "|" case "ssv": delimiter = " " case "tsv": delimiter = "\t" case "csv": delimiter = "," } if reflect.TypeOf(obj).Kind() == reflect.Slice { return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") } else if t, ok := obj.(time.Time); ok { return t.Format(time.RFC3339) } return fmt.Sprintf("%v", obj) // <---- ## HERE ## }
6.2.1
https://gist.github.com/NickUfer/e5f80d9d2173344b4b3331df83e2080e
config file:
disallowAdditionalPropertiesIfNotPresent: true packageName: directusclient generateInterfaces: true structPrefix: true enumClassPrefix: true
cmd:
generate -i /tmp/oas.yaml -g go -o "/tmp/directusclient" -c /tmp/go.yml
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report Checklist
Description
When a path parameter is a oneOf the whole oneOf is serialized and not one of the set values.
This is caused by the
parameterToString
method which serializes the struct to a stringopenapi-generator version
6.2.1
OpenAPI declaration file content or url
https://gist.github.com/NickUfer/e5f80d9d2173344b4b3331df83e2080e
Generation Details
config file:
cmd:
Steps to reproduce
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: