Added component checking for swagger models.

components support now caters to v2, v3 coming shortly - but now it's time for a walk. this shit is exhausting my brain.
This commit is contained in:
Dave Shanley
2022-11-12 15:39:32 -05:00
parent 6694ad54d2
commit 1abc25a923
4 changed files with 655 additions and 4 deletions

View File

@@ -114,3 +114,12 @@ func (sp *SchemaProxy) GetSchemaReference() string {
func (sp *SchemaProxy) GetValueNode() *yaml.Node {
return sp.vn
}
// Hash will return a consistent SHA256 Hash of the SchemaProxy object (it will resolve it)
func (sp *SchemaProxy) Hash() [32]byte {
if sp.rendered != nil {
return sp.rendered.Hash()
} else {
return sp.Schema().Hash()
}
}