Replies: 1 comment
|
Can you open this as an issue? 🙏 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm creating my own OpenAPI contract and I'm using SoundCloud's contract as reference. I noticed that examples to some paths' responses (e.g. 200 OK to GET /tracks/{track_urn}/comments) improperly reference other examples, this is visible in explorer.
This is how it looks like:
{ "collection": { "$ref": "#/components/examples/User/value" }, "next_href": "https://api.soundcloud.com/collection?page_size=10&cursor=1234567" }This is how it should like according to schema and referenced example:
{ "collection": [ { "body": "comment body", "created_at": "2007/09/11 15:40:24 +0000", "urn": "soundcloud:comments:1234", "kind": "comment", "timestamp": 4960, "track_urn": "soundcloud:tracks:123456", "uri": "https://api.soundcloud.com/comments/1234", "user": { "urn": "souncloud:users:12345", "kind": "user", "permalink": "permalink", "username": "user name", "last_modified": "2017/04/10 14:48:03 +0000", "uri": "https://api.soundcloud.com/users/12345", "permalink_url": "https://soundcloud.com/permalink", "avatar_url": "https://i1.sndcdn.com/avatars-large.jpg", "followers_count": 138, "followings_count": 172, "public_favorites_count": 5, "reposts_count": 0 }, "user_urn": "soundcloud:users:12345" } ], "next_href": "https://api.soundcloud.com/collection?page_size=10&cursor=1234567" }I guess this can be fixed by using
dataValue(introduced in oas 3.2.0) instead ofvaluein components/examples/Comments or by defining proper example insideexamplesfield in components/responses/Comments object. Old issue on thic topic: OAI/OpenAPI-Specification#1967All reactions