Skip to content
v1.0.0

Example of an OpenAPI document different schemas


Default


ID: getCircularReference

Get a parent

GET
/circular-reference

Example of a JSON object with a circular reference.

Responses

A parent with a child
application/json
JSON
{
"id": "string",
"child": {
"id": "string",
"parent": "[Circular Reference]"
}
}

Samples

Bruno
get {
  url: http://localhost/circular-reference
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: http://localhost/circular-reference
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'http://localhost/circular-reference' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://localhost/circular-reference', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
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-levels

Example of a JSON object with multiple levels.

Responses

Example of a deeply nested structure
application/json
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"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}

Samples

Bruno
get {
  url: http://localhost/multiple-levels
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: http://localhost/multiple-levels
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'http://localhost/multiple-levels' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://localhost/multiple-levels', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
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-string

Example of a JSON object with a string.

Responses

A string
application/json
JSON
"Hello, World!"

Samples

Bruno
get {
  url: http://localhost/primitive-string
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: http://localhost/primitive-string
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'http://localhost/primitive-string' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://localhost/primitive-string', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
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-number

Example of a JSON object with a number.

Responses

A number
application/json
JSON
42

Samples

Bruno
get {
  url: http://localhost/primitive-number
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: http://localhost/primitive-number
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'http://localhost/primitive-number' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://localhost/primitive-number', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
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-boolean

Example of a JSON object with a boolean.

Responses

A boolean
application/json
JSON
true

Samples

Bruno
get {
  url: http://localhost/primitive-boolean
}

headers {
  Content-Type: application/json
}
Bruno
get {
  url: http://localhost/primitive-boolean
}

headers {
  Content-Type: application/json
}
cURL
curl -X GET \
'http://localhost/primitive-boolean' \
 -H "Content-Type: application/json"
JavaScript
fetch('http://localhost/primitive-boolean', {headers:{'Content-Type':'application/json'}})
  .then(response => response.json())
  .then(data => console.log(data));
PHP
<?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;
?>
Python
import requests

url = 'http://localhost/primitive-boolean'

headers = {
    'Content-Type': 'application/json'
}

response = requests.get(url, headers=headers)
print(response.json())

Powered by VitePress OpenAPI