v1.0.0
Example of an OpenAPI document different schemas
Default
ID: getCircularReference
Get a parent
GET
/circular-referenceExample of a JSON object with a circular reference.
Responses
A parent with a childSchema JSON JSON
application/json
{
"id": "string",
"child": {
"id": "string",
"parent": "[Circular Reference]"
}
}
GET
/circular-referenceSamples
get {
url: http://localhost/circular-reference
}
headers {
Content-Type: application/json
}
get {
url: http://localhost/circular-reference
}
headers {
Content-Type: application/json
}
curl -X GET \
'http://localhost/circular-reference' \
-H "Content-Type: application/json"
fetch('http://localhost/circular-reference', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://localhost/circular-reference';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://localhost/circular-reference'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
ID: getMultipleLevels
Get the root object
GET
/multiple-levelsExample of a JSON object with multiple levels.
Responses
Example of a deeply nested structureSchema JSON JSON
application/json
{
"id": "string",
"level2": {
"id": "string",
"level3": {
"id": "string",
"level4": {
"id": "string",
"level5": {
"id": "string",
"level6": {
"id": "string",
"level7": {
"id": "string",
"level8": {
"id": "string",
"level9": {
"id": "string",
"level10": {
"id": "string",
"level11": {
"id": "string",
"level12": {
"id": "string",
"level13": {
"id": "string",
"level14": {
"id": "string",
"level15": {
"id": "string",
"level16": {
"id": "string",
"level17": {
"id": "string",
"level18": {
"id": "string",
"level19": {
"id": "string",
"level20": {
"id": "string",
"finalValue": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
GET
/multiple-levelsSamples
get {
url: http://localhost/multiple-levels
}
headers {
Content-Type: application/json
}
get {
url: http://localhost/multiple-levels
}
headers {
Content-Type: application/json
}
curl -X GET \
'http://localhost/multiple-levels' \
-H "Content-Type: application/json"
fetch('http://localhost/multiple-levels', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://localhost/multiple-levels';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://localhost/multiple-levels'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
ID: getPrimitiveString
Get a string
GET
/primitive-stringExample of a JSON object with a string.
Responses
A stringSchema JSON JSON
application/json
"Hello, World!"
GET
/primitive-stringSamples
get {
url: http://localhost/primitive-string
}
headers {
Content-Type: application/json
}
get {
url: http://localhost/primitive-string
}
headers {
Content-Type: application/json
}
curl -X GET \
'http://localhost/primitive-string' \
-H "Content-Type: application/json"
fetch('http://localhost/primitive-string', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://localhost/primitive-string';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://localhost/primitive-string'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
ID: getPrimitiveNumber
Get a number
GET
/primitive-numberExample of a JSON object with a number.
Responses
A numberSchema JSON JSON
application/json
42
GET
/primitive-numberSamples
get {
url: http://localhost/primitive-number
}
headers {
Content-Type: application/json
}
get {
url: http://localhost/primitive-number
}
headers {
Content-Type: application/json
}
curl -X GET \
'http://localhost/primitive-number' \
-H "Content-Type: application/json"
fetch('http://localhost/primitive-number', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://localhost/primitive-number';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://localhost/primitive-number'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())
ID: getPrimitiveBoolean
Get a boolean
GET
/primitive-booleanExample of a JSON object with a boolean.
Responses
A booleanSchema JSON JSON
application/json
true
GET
/primitive-booleanSamples
get {
url: http://localhost/primitive-boolean
}
headers {
Content-Type: application/json
}
get {
url: http://localhost/primitive-boolean
}
headers {
Content-Type: application/json
}
curl -X GET \
'http://localhost/primitive-boolean' \
-H "Content-Type: application/json"
fetch('http://localhost/primitive-boolean', {headers:{'Content-Type':'application/json'}})
.then(response => response.json())
.then(data => console.log(data));
<?php
$url = 'http://localhost/primitive-boolean';
$method = 'GET';
$headers = [
'Content-Type' => 'application/json',
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = 'http://localhost/primitive-boolean'
headers = {
'Content-Type': 'application/json'
}
response = requests.get(url, headers=headers)
print(response.json())