File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
test/Microsoft.OpenApi.Tests/Walkers Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,9 @@ public void LocateReferences()
221
221
locator . Locations . Where ( l => l . StartsWith ( "referenceAt:" ) ) . Should ( ) . BeEquivalentTo ( new List < string > {
222
222
"referenceAt: #/paths/~1/get/responses/200/content/application~1json/schema" ,
223
223
"referenceAt: #/paths/~1/get/responses/200/headers/test-header" ,
224
- "referenceAt: #/components/schemas/derived/anyOf/0" ,
224
+ "referenceAt: #/components/schemas/derived" ,
225
+ "referenceAt: #/components/schemas/derived/anyOf" ,
226
+ "referenceAt: #/components/schemas/base" ,
225
227
"referenceAt: #/components/headers/test-header/schema"
226
228
} ) ;
227
229
}
@@ -291,7 +293,14 @@ public override void Visit(OpenApiMediaType mediaType)
291
293
292
294
public override void Visit ( ref JsonSchema schema )
293
295
{
294
- Locations . Add ( this . PathString ) ;
296
+ if ( schema . GetRef ( ) != null )
297
+ {
298
+ Locations . Add ( "referenceAt: " + this . PathString ) ;
299
+ }
300
+ else
301
+ {
302
+ Locations . Add ( this . PathString ) ;
303
+ }
295
304
}
296
305
297
306
public override void Visit ( IList < OpenApiTag > openApiTags )
You can’t perform that action at this time.
0 commit comments