@@ -126,12 +126,11 @@ func (v *responseBodyValidator) checkResponseSchema(
126
126
// have we seen this schema before? let's hash it and check the cache.
127
127
hash := mediaType .GoLow ().Schema .Value .Hash ()
128
128
129
- if cacheHit , ch := v .schemaCache [hash ]; ch {
130
-
129
+ if cacheHit , ch := v .schemaCache .Load (hash ); ch {
131
130
// got a hit, use cached values
132
- schema = cacheHit .schema
133
- renderedInline = cacheHit .renderedInline
134
- renderedJSON = cacheHit .renderedJSON
131
+ schema = cacheHit .( * schemaCache ). schema
132
+ renderedInline = cacheHit .( * schemaCache ). renderedInline
133
+ renderedJSON = cacheHit .( * schemaCache ). renderedJSON
135
134
136
135
} else {
137
136
@@ -140,11 +139,11 @@ func (v *responseBodyValidator) checkResponseSchema(
140
139
schema = mediaType .Schema .Schema ()
141
140
renderedInline , _ = schema .RenderInline ()
142
141
renderedJSON , _ = utils .ConvertYAMLtoJSON (renderedInline )
143
- v .schemaCache [ hash ] = & schemaCache {
142
+ v .schemaCache . Store ( hash , & schemaCache {
144
143
schema : schema ,
145
144
renderedInline : renderedInline ,
146
145
renderedJSON : renderedJSON ,
147
- }
146
+ })
148
147
}
149
148
150
149
// render the schema, to be used for validation
0 commit comments