-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fluff out code-samples even more
- Loading branch information
1 parent
2df7dc9
commit 9c0441a
Showing
1 changed file
with
66 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,32 @@ | |
"summary": "Custom code samples with the \"x-readme.code-samples\" extension", | ||
"description": "This is a demonstration of our handling of our `x-readme.code-samples` extension.\n\nhttps://docs.readme.com/docs/openapi-extensions#custom-code-samples", | ||
"tags": ["Custom code samples"], | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Tag" | ||
}, | ||
"examples": { | ||
"userRegistration": { | ||
"value": { | ||
"id": 1234, | ||
"email": "[email protected]", | ||
"name": "Test user name" | ||
} | ||
}, | ||
"userRegistration alt": { | ||
"value": { | ||
"id": 5678, | ||
"email": "[email protected]", | ||
"name": "Test user name" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
|
@@ -62,6 +88,21 @@ | |
} | ||
} | ||
} | ||
}, | ||
"404": { | ||
"description": "Not Found", | ||
"content": { | ||
"application/json": { | ||
"examples": { | ||
"curlExample": { | ||
"summary": "An example of a cat", | ||
"value": { | ||
"missing": "can't find your stuff dawg" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"x-readme": { | ||
|
@@ -76,15 +117,37 @@ | |
{ | ||
"name": "Another cURL snippet", | ||
"language": "curl", | ||
"code": "curl -X POST https://api.example.com/v2/another-alert", | ||
"install": "brew install curl" | ||
"code": "http POST https://api.example.com/v2/another-alert", | ||
"install": "brew install httpie", | ||
"correspondingExample": "curlExample" | ||
}, | ||
{ | ||
"language": "curl", | ||
"code": "# This custom cURL snippet does not have a custom name so it has the name of \"Default #2\".\n\ncurl -X POST https://api.example.com/v2/alert" | ||
}, | ||
{ | ||
"name": "Yet another custom snippet", | ||
"language": "curl", | ||
"code": "curl -X POST https://api.example.com/v2/alert", | ||
"install": "brew install curl", | ||
"correspondingExample": "TestExample" | ||
}, | ||
{ | ||
"name": "Yet another custom snippet", | ||
"language": "python", | ||
"code": "import requests\n\nprint(\"do something idk\")", | ||
"install": "pip install requests", | ||
"correspondingExample": "TestExample" | ||
}, | ||
{ | ||
"name": "Yet another custom snippet", | ||
"language": "node", | ||
"code": "import something from 'requestidk';\n\nconsole.log('do something idk');", | ||
"install": "npm install requestidk", | ||
"correspondingExample": "curlExample" | ||
} | ||
], | ||
"samples-languages": ["shell"] | ||
"samples-languages": ["shell", "python", "node"] | ||
} | ||
}, | ||
"get": { | ||
|