File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 Upstream Go codegen ignores `nullable: true ` inside additionalProperties when
44 computing the map value type, producing `map[string]string` instead of
55 `map[string]*string`. This partial restores the missing `*` on the map value
6- when the additionalProperties schema is nullable, and otherwise emits
7- the upstream-computed dataType unchanged.
8- } }{ {#isMap} }{ {#additionalProperties.isNullable} }map[string]*{ {{additionalProperties.dataType} }}{ {/additionalProperties.isNullable} }{ {^additionalProperties.isNullable} }{ {{dataType} }}{ {/additionalProperties.isNullable} }{ {/isMap} }{ {^isMap} }{ {{dataType} }}{ {/isMap} }
6+ when the additionalProperties schema is nullable AND the schema is a typed map
7+ (not a free-form object, where dataType is already `map[string]interface{} `
8+ and pointer-wrapping the value would produce `map[string]*interface{ } `).
9+ Otherwise it emits the upstream-computed dataType unchanged.
10+ }}{ {#isMap} }{ {^isFreeFormObject} }{ {#additionalProperties.isNullable} }map[string]*{ {{additionalProperties.dataType} }}{ {/additionalProperties.isNullable} }{ {^additionalProperties.isNullable} }{ {{dataType} }}{ {/additionalProperties.isNullable} }{ {/isFreeFormObject} }{ {#isFreeFormObject} }{ {{dataType} }}{ {/isFreeFormObject} }{ {/isMap} }{ {^isMap} }{ {{dataType} }}{ {/isMap} }
Original file line number Diff line number Diff line change 33 Upstream Go codegen ignores `nullable: true ` inside additionalProperties when
44 computing the map value type, producing `map[string]string` instead of
55 `map[string]*string`. This partial restores the missing `*` on the map value
6- when the additionalProperties schema is nullable, and otherwise emits
7- the upstream-computed dataType unchanged.
8- } }{ {#isMap} }{ {#additionalProperties.isNullable} }map[string]*{ {{additionalProperties.dataType} }}{ {/additionalProperties.isNullable} }{ {^additionalProperties.isNullable} }{ {{dataType} }}{ {/additionalProperties.isNullable} }{ {/isMap} }{ {^isMap} }{ {{dataType} }}{ {/isMap} }
6+ when the additionalProperties schema is nullable AND the schema is a typed map
7+ (not a free-form object, where dataType is already `map[string]interface{} `
8+ and pointer-wrapping the value would produce `map[string]*interface{ } `).
9+ Otherwise it emits the upstream-computed dataType unchanged.
10+ }}{ {#isMap} }{ {^isFreeFormObject} }{ {#additionalProperties.isNullable} }map[string]*{ {{additionalProperties.dataType} }}{ {/additionalProperties.isNullable} }{ {^additionalProperties.isNullable} }{ {{dataType} }}{ {/additionalProperties.isNullable} }{ {/isFreeFormObject} }{ {#isFreeFormObject} }{ {{dataType} }}{ {/isFreeFormObject} }{ {/isMap} }{ {^isMap} }{ {{dataType} }}{ {/isMap} }
Original file line number Diff line number Diff line change 11{ {!
22 Renders the Go base (unwrapped) type for a property, accounting for nullable
33 additionalProperties. Used in getter/setter signatures where upstream emits
4- the vendor base type. For map types whose additionalProperties schema is
4+ the vendor base type. For typed maps whose additionalProperties schema is
55 nullable, upstream ignores nullable= true and produces map[string]string
6- instead of map[string]*string. This partial restores the missing pointer
7- in that case , and otherwise emits the upstream base type unchanged.
8- } }{ {#isMap} }{ {#additionalProperties.isNullable} }map[string]*{ {{additionalProperties.dataType} }}{ {/additionalProperties.isNullable} }{ {^additionalProperties.isNullable} }{ {vendorExtensions.x-go-base-type} }{ {/additionalProperties.isNullable} }{ {/isMap} }{ {^isMap} }{ {vendorExtensions.x-go-base-type} }{ {/isMap} }
6+ instead of map[string]*string. This partial restores the missing pointer in
7+ that case . Free-form objects (`additionalProperties: true ` -> dataType
8+ `map[string]interface{} `) are excluded so we don't produce
9+ `map[string]*interface{ } `. Otherwise the upstream base type is emitted
10+ unchanged.
11+ }}{ {#isMap} }{ {^isFreeFormObject} }{ {#additionalProperties.isNullable} }map[string]*{ {{additionalProperties.dataType} }}{ {/additionalProperties.isNullable} }{ {^additionalProperties.isNullable} }{ {vendorExtensions.x-go-base-type} }{ {/additionalProperties.isNullable} }{ {/isFreeFormObject} }{ {#isFreeFormObject} }{ {vendorExtensions.x-go-base-type} }{ {/isFreeFormObject} }{ {/isMap} }{ {^isMap} }{ {vendorExtensions.x-go-base-type} }{ {/isMap} }
You can’t perform that action at this time.
0 commit comments