> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://akamai.ferndocs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://akamai.ferndocs.com/_mcp/server.

# Test oneOf polymorphism

PUT http://{hostname}/test-suite/v2/data/polymorphic/one-of
Content-Type: application/json

This tests `oneOf` schemas.

Reference: https://akamai.ferndocs.com/demo-apis/api/data/poly/put-oneof

## Request

### Query parameters

- `accountSwitchKey` (string, optional) — For customers who manage more than one account, this [runs the operation from another account](https://techdocs.akamai.com/developer/docs/manage-many-accounts-with-one-api-client). The Identity and Access Management API provides a [list of available account switch keys](https://techdocs.akamai.com/iam-api/reference/get-client-account-switch-keys).

### Body (application/json)

This endpoint expects an object.

- `isOneOf` (DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaIsOneOf, required)
- `nestedOneOf` (DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaNestedOneOf, optional) — This features alternate `oneOf` schemas that nest further nested `oneOf` schemas. It should publish four Beatles and four Stones.
- `oneOfExclude` (DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaOneOfExclude, optional) — Test whether a `oneOf` item can be excluded. The `gummo` key should not publish. (Not quite)
- `oneOfInArray` (list of DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaOneOfInArrayItems, optional) — Array of items, each a `oneOf`.
- `schema-poly-alt-nests-allof` (DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof, optional)
- `schema-poly-alt-nests-allof-inline` (DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline, optional) — This features alternate `oneOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones.
- `schema-poly-single` (DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolySingle, optional) — This schema specifies a single `oneOf` item.

## Response

### 200

Successful response.

- `isOneOf` (DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaIsOneOf, required)
- `nestedOneOf` (DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaNestedOneOf, optional) — This features alternate `oneOf` schemas that nest further nested `oneOf` schemas. It should publish four Beatles and four Stones.
- `oneOfExclude` (DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaOneOfExclude, optional) — Test whether a `oneOf` item can be excluded. The `gummo` key should not publish. (Not quite)
- `oneOfInArray` (list of DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaOneOfInArrayItems, optional) — Array of items, each a `oneOf`.
- `schema-poly-alt-nests-allof` (DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof, optional)
- `schema-poly-alt-nests-allof-inline` (DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline, optional) — This features alternate `oneOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones.
- `schema-poly-single` (DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolySingle, optional) — This schema specifies a single `oneOf` item.

## Types

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaIsOneOf

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaNestedOneOf

This features alternate `oneOf` schemas that nest further nested `oneOf` schemas. It should publish four Beatles and four Stones.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaOneOfExclude

Test whether a `oneOf` item can be excluded. The `gummo` key should not publish. (Not quite)

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaOneOfInArrayItems

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline

This features alternate `oneOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolySingle

This schema specifies a single `oneOf` item.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaIsOneOf

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaNestedOneOf

This features alternate `oneOf` schemas that nest further nested `oneOf` schemas. It should publish four Beatles and four Stones.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaOneOfExclude

Test whether a `oneOf` item can be excluded. The `gummo` key should not publish. (Not quite)

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaOneOfInArrayItems

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline

This features alternate `oneOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolySingle

This schema specifies a single `oneOf` item.

### Groucho

- `groucho` (boolean, required) — Groucho description.

### Chico

- `chico` (boolean, required) — Chico description.

### Harpo

- `harpo` (boolean, required) — Harpo description.

### Groucho

A `oneOf` item. This should publish.

- `groucho` (boolean, optional) — This schema is defined within a `oneOf`.

### Chico

A `oneOf` item. This should publish.

- `chico` (boolean, optional) — This schema is defined within a `oneOf`.

### Harpo

A `oneOf` item. This should publish.

- `harpo` (boolean, optional) — This schema is defined within a `oneOf`.

### Beatles

Description comes from `beatles-all.yaml`.

- `george` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `john` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `paul` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `ringo` (boolean, optional) — Description comes from `beatles-all.yaml`.

### Stones

Description comes from `stones-all.yaml`.

- `brian` (boolean, optional) — Description comes from `stones-all.yaml`.
- `charlie` (boolean, optional) — Description comes from `stones-all.yaml`.
- `keith` (boolean, optional) — Description comes from `stones-all.yaml`.
- `mick` (boolean, optional) — Description comes from `stones-all.yaml`.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof0

Description comes from `beatles-dead.yaml`.

- `paul` (boolean, optional) — Description comes from `beatles-alive.yaml`.
- `ringo` (boolean, optional) — Description comes from `beatles-alive.yaml`.
- `george` (boolean, optional) — Description comes from `beatles-dead.yaml`.
- `john` (boolean, optional) — Description comes from `beatles-dead.yaml`.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof1

Description comes from `stones-dead.yaml`.

- `keith` (boolean, optional) — Description comes from `stones-alive.yaml`.
- `mick` (boolean, optional) — Description comes from `stones-alive.yaml`.
- `brian` (boolean, optional) — Description comes from `stones-dead.yaml`.
- `charlie` (boolean, optional) — Description comes from `stones-dead.yaml`.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline0

Description is inline.

- `john` (boolean, optional) — Description is inline.
- `paul` (boolean, optional) — Description is inline.
- `george` (boolean, optional) — Description is inline.
- `ringo` (boolean, optional) — Description is inline.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline1

Description is inline.

- `keith` (boolean, optional) — Description is inline.
- `mick` (boolean, optional) — Description is inline.
- `brian` (boolean, optional) — Description is inline.
- `charlie` (boolean, optional) — Description is inline.

### DataPolymorphicOneOfPutRequestBodyContentApplicationJsonSchemaSchemaPolySingle0

Description comes from `beatles-all.yaml`.

- `george` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `john` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `paul` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `ringo` (boolean, optional) — Description comes from `beatles-all.yaml`.

### Groucho

- `groucho` (boolean, required) — Groucho description.

### Chico

- `chico` (boolean, required) — Chico description.

### Harpo

- `harpo` (boolean, required) — Harpo description.

### Groucho

A `oneOf` item. This should publish.

- `groucho` (boolean, optional) — This schema is defined within a `oneOf`.

### Chico

A `oneOf` item. This should publish.

- `chico` (boolean, optional) — This schema is defined within a `oneOf`.

### Harpo

A `oneOf` item. This should publish.

- `harpo` (boolean, optional) — This schema is defined within a `oneOf`.

### Beatles

Description comes from `beatles-all.yaml`.

- `george` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `john` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `paul` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `ringo` (boolean, optional) — Description comes from `beatles-all.yaml`.

### Stones

Description comes from `stones-all.yaml`.

- `brian` (boolean, optional) — Description comes from `stones-all.yaml`.
- `charlie` (boolean, optional) — Description comes from `stones-all.yaml`.
- `keith` (boolean, optional) — Description comes from `stones-all.yaml`.
- `mick` (boolean, optional) — Description comes from `stones-all.yaml`.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof0

Description comes from `beatles-dead.yaml`.

- `paul` (boolean, optional) — Description comes from `beatles-alive.yaml`.
- `ringo` (boolean, optional) — Description comes from `beatles-alive.yaml`.
- `george` (boolean, optional) — Description comes from `beatles-dead.yaml`.
- `john` (boolean, optional) — Description comes from `beatles-dead.yaml`.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof1

Description comes from `stones-dead.yaml`.

- `keith` (boolean, optional) — Description comes from `stones-alive.yaml`.
- `mick` (boolean, optional) — Description comes from `stones-alive.yaml`.
- `brian` (boolean, optional) — Description comes from `stones-dead.yaml`.
- `charlie` (boolean, optional) — Description comes from `stones-dead.yaml`.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline0

Description is inline.

- `john` (boolean, optional) — Description is inline.
- `paul` (boolean, optional) — Description is inline.
- `george` (boolean, optional) — Description is inline.
- `ringo` (boolean, optional) — Description is inline.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline1

Description is inline.

- `keith` (boolean, optional) — Description is inline.
- `mick` (boolean, optional) — Description is inline.
- `brian` (boolean, optional) — Description is inline.
- `charlie` (boolean, optional) — Description is inline.

### DataPolymorphicOneOfPutResponsesContentApplicationJsonSchemaSchemaPolySingle0

Description comes from `beatles-all.yaml`.

- `george` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `john` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `paul` (boolean, optional) — Description comes from `beatles-all.yaml`.
- `ringo` (boolean, optional) — Description comes from `beatles-all.yaml`.

## Examples

**Request**

```json
{
  "isOneOf": {
    "groucho": true
  }
}
```

**Response**

```json
{
  "isOneOf": {
    "groucho": true
  }
}
```

**SDK Code**

```python
import requests

url = "http://{hostname}/test-suite/v2/data/polymorphic/one-of"

payload = { "isOneOf": { "groucho": True } }
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://{hostname}/test-suite/v2/data/polymorphic/one-of';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"isOneOf":{"groucho":true}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://{hostname}/test-suite/v2/data/polymorphic/one-of"

	payload := strings.NewReader("{\n  \"isOneOf\": {\n    \"groucho\": true\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://{hostname}/test-suite/v2/data/polymorphic/one-of")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"isOneOf\": {\n    \"groucho\": true\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("http://{hostname}/test-suite/v2/data/polymorphic/one-of")
  .header("Content-Type", "application/json")
  .body("{\n  \"isOneOf\": {\n    \"groucho\": true\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://{hostname}/test-suite/v2/data/polymorphic/one-of', [
  'body' => '{
  "isOneOf": {
    "groucho": true
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://{hostname}/test-suite/v2/data/polymorphic/one-of");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"isOneOf\": {\n    \"groucho\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["isOneOf": ["groucho": true]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://{hostname}/test-suite/v2/data/polymorphic/one-of")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```