-
Notifications
You must be signed in to change notification settings - Fork 86
Open
getkin/kin-openapi
#1086Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
If aparameter gets a reference in its examples, Error: diff failed: example reference is nil is thrown.
To Reproduce
Try to get a changelog for these two yamls:
openapi: 3.0.3
servers:
- url: http://localhost:8080
info:
title: Example with references API
description: Example with references API
version: 1.0.0
contact:
name: Jane Doe
url: https://google.com
components:
parameters:
SortBy:
name: sortBy
in: query
description: >-
This is where it all goes downhill
schema:
type: string
examples:
NiceExample:
$ref: '#/components/examples/NiceExample'
examples:
NiceExample:
summary: Just a nice example.
value: fooBar
=======
openapi: 3.0.3
servers:
- url: http://localhost:8080
info:
title: Example with references API
description: Example with references API
version: 1.0.0
contact:
name: Jane Doe
url: https://google.com
components:
parameters:
SortBy:
name: sortBy
in: query
description: >-
This is fine
schema:
type: string
examples:
NiceExample:
summary: Just a nice example.
value: fooBar
The second one can be compared to any other openapi spec and works just fine, but the one with the reference in the parameters breaks.
When I was searching for this bug, I traced it back to here.
Expected behavior
It should handle a reference in a parameter's example
Desktop:
- OS: MacOS
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working