Hi,
I wish the generated code had a method "Validate()" or similar that, given a Go struct instance, checks whether all required fields are present and whether their content is compliant with the JSON schema.
This would be very useful during e.g. unit testing:
testStruct := myMethodThatPopulatesRequestMsg()
// t is an instance of generatedGoStruct
assert.True(t, testStruct.Validate()) // check that all fields were populated successfully
Is this achievable somehow today?
Hi,
I wish the generated code had a method "Validate()" or similar that, given a Go struct instance, checks whether all required fields are present and whether their content is compliant with the JSON schema.
This would be very useful during e.g. unit testing:
Is this achievable somehow today?