Skip to content

Commit

Permalink
feat: fluff out code-samples even more
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Apr 17, 2024
1 parent 2df7dc9 commit 9c0441a
Showing 1 changed file with 66 additions and 3 deletions.
69 changes: 66 additions & 3 deletions 3.0/json/readme-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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": {
Expand All @@ -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": {
Expand Down

0 comments on commit 9c0441a

Please sign in to comment.