mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 06:01:52 +08:00

* JSON fields that start with special characters generate wrong typescript bindings * Update changelong
33 lines
689 B
Go
33 lines
689 B
Go
package binding_test
|
|
|
|
type SpecialCharacterField struct {
|
|
ID string `json:"@ID,omitempty"`
|
|
}
|
|
|
|
func (s SpecialCharacterField) Get() SpecialCharacterField {
|
|
return s
|
|
}
|
|
|
|
var SpecialCharacterFieldTest = BindingTest{
|
|
name: "SpecialCharacterField",
|
|
structs: []interface{}{
|
|
&SpecialCharacterField{},
|
|
},
|
|
exemptions: nil,
|
|
shouldError: false,
|
|
want: `
|
|
export namespace binding_test {
|
|
export class SpecialCharacterField {
|
|
"@ID"?: string;
|
|
static createFrom(source: any = {}) {
|
|
return new SpecialCharacterField(source);
|
|
}
|
|
constructor(source: any = {}) {
|
|
if ('string' === typeof source) source = JSON.parse(source);
|
|
this["@ID"] = source["@ID"];
|
|
}
|
|
}
|
|
}
|
|
`,
|
|
}
|