> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://akamai.ferndocs.com/demo-apis/api/data/poly/put-anyof/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://akamai.ferndocs.com/_mcp/server. # Test anyOf polymorphism PUT http://{hostname}/test-suite/v2/data/polymorphic/any-of Content-Type: application/json This tests `anyOf` schemas. Reference: https://akamai.ferndocs.com/demo-apis/api/data/poly/put-anyof ## 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. - `isAnyOf` (DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaIsAnyOf, required) - `anyOfExclude` (DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaAnyOfExclude, optional) — Test whether an `anyOf` item can be excluded. The `gummo` key should not publish. (Not quite) - `schema-poly-alt-nests-allof` (DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof, optional) — This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. - `schema-poly-alt-nests-allof-inline` (DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline, optional) — This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. - `schema-poly-single` (DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolySingle, optional) — This schema specifies a single `anyOf` item. ## Response ### 200 Successful response. - `isAnyOf` (DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaIsAnyOf, required) - `anyOfExclude` (DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaAnyOfExclude, optional) — Test whether an `anyOf` item can be excluded. The `gummo` key should not publish. (Not quite) - `schema-poly-alt-nests-allof` (DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof, optional) — This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. - `schema-poly-alt-nests-allof-inline` (DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline, optional) — This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. - `schema-poly-single` (DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolySingle, optional) — This schema specifies a single `anyOf` item. ## Types ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaIsAnyOf ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaAnyOfExclude Test whether an `anyOf` item can be excluded. The `gummo` key should not publish. (Not quite) ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolySingle This schema specifies a single `anyOf` item. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaIsAnyOf ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaAnyOfExclude Test whether an `anyOf` item can be excluded. The `gummo` key should not publish. (Not quite) ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline This features alternate `anyOf` schemas that nest further nested `allOf` schemas. It should publish four Beatles and four Stones. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolySingle This schema specifies a single `anyOf` item. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaIsAnyOf0 Alternative schema, unconditional. - `groucho` (boolean, required) — Groucho description. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaIsAnyOf1 __Beta__ Alternative schema, conditional. - `chico` (boolean, required) — Chico description. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaIsAnyOf2 __Bot manager__ Alternative schema, conditional. - `harpo` (boolean, required) — Harpo description. ### Groucho An `anyOf` item. This should publish. - `groucho` (boolean, optional) — This schema is defined within an `anyOf`. ### Chico An `anyOf` item. This should publish. - `chico` (boolean, optional) — This schema is defined within an `anyOf`. ### Harpo An `anyOf` item. This should publish. - `harpo` (boolean, optional) — This schema is defined within an `anyOf`. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof0 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`. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllof1 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`. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline0 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. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline1 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. ### DataPolymorphicAnyOfPutRequestBodyContentApplicationJsonSchemaSchemaPolySingle0 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`. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaIsAnyOf0 Alternative schema, unconditional. - `groucho` (boolean, required) — Groucho description. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaIsAnyOf1 __Beta__ Alternative schema, conditional. - `chico` (boolean, required) — Chico description. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaIsAnyOf2 __Bot manager__ Alternative schema, conditional. - `harpo` (boolean, required) — Harpo description. ### Groucho An `anyOf` item. This should publish. - `groucho` (boolean, optional) — This schema is defined within an `anyOf`. ### Chico An `anyOf` item. This should publish. - `chico` (boolean, optional) — This schema is defined within an `anyOf`. ### Harpo An `anyOf` item. This should publish. - `harpo` (boolean, optional) — This schema is defined within an `anyOf`. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof0 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`. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllof1 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`. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline0 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. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolyAltNestsAllofInline1 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. ### DataPolymorphicAnyOfPutResponsesContentApplicationJsonSchemaSchemaPolySingle0 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 { "isAnyOf": { "groucho": true } } ``` **Response** ```json { "isAnyOf": { "groucho": true } } ``` **SDK Code** ```python import requests url = "http://{hostname}/test-suite/v2/data/polymorphic/any-of" payload = { "isAnyOf": { "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/any-of'; const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"isAnyOf":{"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/any-of" payload := strings.NewReader("{\n \"isAnyOf\": {\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/any-of") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Put.new(url) request["Content-Type"] = 'application/json' request.body = "{\n \"isAnyOf\": {\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 response = Unirest.put("http://{hostname}/test-suite/v2/data/polymorphic/any-of") .header("Content-Type", "application/json") .body("{\n \"isAnyOf\": {\n \"groucho\": true\n }\n}") .asString(); ``` ```php request('PUT', 'http://{hostname}/test-suite/v2/data/polymorphic/any-of', [ 'body' => '{ "isAnyOf": { "groucho": true } }', 'headers' => [ 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("http://{hostname}/test-suite/v2/data/polymorphic/any-of"); var request = new RestRequest(Method.PUT); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"isAnyOf\": {\n \"groucho\": true\n }\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Content-Type": "application/json"] let parameters = ["isAnyOf": ["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/any-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() ```