mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 13:44:54 +03:00
make buttons less wonky — cheap, fast substitute for a selector
This commit is contained in:
parent
2a6b40d2ed
commit
a1ca495bda
|
@ -132,7 +132,62 @@ paths:
|
|||
// Something wrong -- check response for errors
|
||||
Console.WriteLine(response.getRawResponse());
|
||||
}
|
||||
- lang: PHP
|
||||
- lang: Shell + curl
|
||||
source: |
|
||||
$form = new \PetStore\Entities\Pet();
|
||||
$form->setPetType("Dog");
|
||||
$form->setName("Rex");
|
||||
// set other fields
|
||||
try {
|
||||
$pet = $client->pets()->create($form);
|
||||
} catch (UnprocessableEntityException $e) {
|
||||
var_dump($e->getErrors());
|
||||
}
|
||||
- lang: Node + native
|
||||
source: |
|
||||
$form = new \PetStore\Entities\Pet();
|
||||
$form->setPetType("Dog");
|
||||
$form->setName("Rex");
|
||||
// set other fields
|
||||
try {
|
||||
$pet = $client->pets()->create($form);
|
||||
} catch (UnprocessableEntityException $e) {
|
||||
var_dump($e->getErrors());
|
||||
}
|
||||
- lang: Go + native
|
||||
source: |
|
||||
$form = new \PetStore\Entities\Pet();
|
||||
$form->setPetType("Dog");
|
||||
$form->setName("Rex");
|
||||
// set other fields
|
||||
try {
|
||||
$pet = $client->pets()->create($form);
|
||||
} catch (UnprocessableEntityException $e) {
|
||||
var_dump($e->getErrors());
|
||||
}
|
||||
- lang: Ruby + native
|
||||
source: |
|
||||
$form = new \PetStore\Entities\Pet();
|
||||
$form->setPetType("Dog");
|
||||
$form->setName("Rex");
|
||||
// set other fields
|
||||
try {
|
||||
$pet = $client->pets()->create($form);
|
||||
} catch (UnprocessableEntityException $e) {
|
||||
var_dump($e->getErrors());
|
||||
}
|
||||
- lang: Javascript + jquery
|
||||
source: |
|
||||
$form = new \PetStore\Entities\Pet();
|
||||
$form->setPetType("Dog");
|
||||
$form->setName("Rex");
|
||||
// set other fields
|
||||
try {
|
||||
$pet = $client->pets()->create($form);
|
||||
} catch (UnprocessableEntityException $e) {
|
||||
var_dump($e->getErrors());
|
||||
}
|
||||
- lang: Python + python3
|
||||
source: |
|
||||
$form = new \PetStore\Entities\Pet();
|
||||
$form->setPetType("Dog");
|
||||
|
|
|
@ -31,8 +31,14 @@ export class RequestSamples extends React.Component<RequestSamplesProps> {
|
|||
<Tabs defaultIndex={0}>
|
||||
<TabList hidden={hideTabList}>
|
||||
{samples.map(sample => (
|
||||
<Tab key={sample.lang + '_' + (sample.label || '')}>
|
||||
{sample.label !== undefined ? sample.label : sample.lang}
|
||||
<Tab className="exampleButton" key={sample.lang + '_' + (sample.label || '')}>
|
||||
{sample.label !== undefined ? sample.label :
|
||||
sample.lang === 'Shell + curl' ? sample.lang.slice(8) :
|
||||
sample.lang === 'Node + native' ? sample.lang.slice(0, 4) :
|
||||
sample.lang === 'Go + native' ? sample.lang.slice(0, 2) :
|
||||
sample.lang === 'Ruby + native' ? sample.lang.slice(0, 4) :
|
||||
sample.lang === 'Python + python3' ? sample.lang.slice(9) :
|
||||
sample.lang === 'Javascript + jquery' ? sample.lang.slice(0, 10) : sample.lang}
|
||||
</Tab>
|
||||
))}
|
||||
</TabList>
|
||||
|
|
Loading…
Reference in New Issue
Block a user