Get a tags array
Example of a JSON object with an array of tags using items schema.
Responses
An object containing an array of tags
An object containing arrays of tags and related metadata for categorization and organization
A collection of string tags used for categorizing content or items
Additional information related to the tags including supplementary data
Get a parent
Example of a JSON object with a circular reference.
Responses
A parent with a child
A parent object that demonstrates circular references by containing a child that references back to its parent
Unique identifier for the parent object
Reference to a child object that belongs to this parent
Get the root object
Example of a JSON object with multiple levels.
Responses
Example of a deeply nested structure
The top level of a deeply nested structure demonstrating how OpenAPI can handle complex hierarchical data
Unique identifier for this level 1 object
Reference to the next level in the nested structure (level 2)
Get a string
Get a number
Get a boolean
Get a nullable object
Example of a JSON object that can be null.
Responses
A nullable object
An object that can be either a valid object with properties or null
, demonstrating OpenAPI's support for nullable types
Unique identifier for the object when it's not null
Name or title associated with this object
Detailed text description providing additional information about the object. This field can contain formatted text for better readability.
Get a tuple array with prefixItems
Example of a JSON array with prefixItems defining a tuple structure.
Responses
A tuple array with fixed positions
A tuple array with fixed position types using prefixItems. This demonstrates how to create arrays with a specific structure where each position contains a predetermined type.
5
5
First element - always a string, typically used for identifiers or names
Second element - always a number, can represent quantities, measurements, or scores
Third element - always a boolean, useful for flags or toggle states
Fourth element - a complex object with its own structure and properties
Fifth element - an array of strings, useful for tags, categories, or other collections
Get a mixed array with prefixItems and items
Example of a JSON array with both prefixItems and items schemas.
Responses
An array with fixed positions followed by additional items
An array with both prefixItems and items schemas, demonstrating a hybrid approach to array definition. This combines fixed position elements at the beginning with variable additional elements of the same type.
2
First element - always a string identifier that uniquely identifies the entire array data structure
Second element - user metadata containing basic information about the user associated with this data
Additional elements - data entries that can appear in any quantity after the fixed prefix items. Each represents a discrete data point with timestamp and value.
Test complex schema with oneOf and anyOf
Example of a complex request and response schema using oneOf and anyOf.
Request Body
A complex request object demonstrating advanced OpenAPI features including oneOf
and anyOf
schemas. This represents a flexible API request that can handle multiple data types.
Example:
{
"id": "req-12345",
"timestamp": "2023-05-20T15:30:45Z",
"data": {
"type": "order",
"order": {
"id": "order-123",
"customer": {
"id": "cust-456",
"name": "John Doe"
},
"items": [
{
"productId": "prod-456",
"quantity": 2,
"unitPrice": 599.99
}
],
"totalAmount": 1199.98
}
},
"metadata": { "source": "web", "priority": "high", "tags": ["important", "sales"] } }
Unique identifier for the request, used for tracking and reference purposes
When the request was created, in ISO 8601 format with timezone information
"date-time"
The main data payload that can be one of several types, using the oneOf discriminator pattern to support multiple object structures
Additional metadata that can include any combination of these fields using the anyOf schema pattern. This allows for flexible metadata combinations where one or more of these objects can be included.
Responses
Complex response with oneOf and anyOf schemas
A complex response object demonstrating advanced OpenAPI features including nested oneOf
and anyOf
schemas. This represents a flexible API response that can return different result types based on the operation outcome.
Example:
{
"id": "resp-67890",
"status": "success",
"result": {
"type": "success",
"data": {
"transaction": {
"id": "txn-123456",
"amount": 1299.99,
"currency": "USD",
"paymentMethod": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa",
"expiryMonth": 12,
"expiryYear": 2025
}
}
}
}
},
"metadata": { "processingTime": 235.45, "region": "us-west-1", "version": "v2.3.1" } }
Unique identifier for the response that can be used for tracking and debugging purposes. This correlates with the request ID.
Overall status of the operation indicating whether it succeeded, partially succeeded, or failed. This field helps clients quickly determine the outcome without parsing the entire response.
"success"
"partial"
"error"
The result data with nested oneOf and anyOf patterns, providing a flexible response structure that can adapt to different scenarios and operation outcomes.
Additional metadata with anyOf pattern, providing supplementary information about the response. This allows for flexible combinations of metadata fields to be included based on the context.