fix(golang): make object values nullable when specified
Merged
RU
4mo ago+46+46+01234567890123456789-1-1-0123456789
relates to #24264
Detailed description and testing instructions can be found in the GitHub issue.
PR checklist
- Read the contribution guidelines.
- Run the following to build the project and update samples:
(For Windows users, please run the script in WSL)./mvnw clean package || exit ./bin/generate-samples.sh ./bin/configs/*.yaml || exit ./bin/utils/export_docs_generators.sh || exit
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*.
IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed. - If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
@antihax @grokify @kemokemo @jirikuncar @ph4r5h4d @lwj5
Summary by cubic
Fixes Go codegen to respect nullable for additionalProperties values. Generates map[string]*T when the value schema is nullable: true, skips pointers for map/slice values, and defaults to interface{} when no value schema is provided.
- Bug Fixes
- Map values use pointers only when the inner schema is nullable and not a map/slice.
- Nested objects honor nullable on inner values (e.g.,
map[string]map[string]*string).