Challenge - 5 Problems
Endpoint Documentation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:30remaining
What is the output of this OpenAPI snippet?
Given this OpenAPI endpoint documentation snippet, what is the value of the
summary field for the GET method?Rest API
{
"paths": {
"/users": {
"get": {
"summary": "Retrieve list of users",
"responses": {
"200": {
"description": "A JSON array of user names"
}
}
}
}
}
}Attempts:
2 left
💡 Hint
Look for the
summary key inside the GET method object.✗ Incorrect
The
summary field describes the purpose of the endpoint method. Here, it is "Retrieve list of users".🧠 Conceptual
intermediate1:00remaining
Which field describes the expected response status code in REST API docs?
In REST API endpoint documentation, which field typically specifies the HTTP status code returned by the server?
Attempts:
2 left
💡 Hint
Think about where the server tells what it sends back.
✗ Incorrect
The
responses field contains HTTP status codes and descriptions of the server's replies.🔧 Debug
advanced2:00remaining
Identify the error in this endpoint documentation snippet
What error will this OpenAPI snippet cause when validating the documentation?
Rest API
{
"paths": {
"/items/{itemId}": {
"get": {
"parameters": [
{
"name": "itemId",
"in": "query",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Item details"
}
}
}
}
}
}Attempts:
2 left
💡 Hint
Check the
in field for the path parameter.✗ Incorrect
Path parameters must have
in set to "path". Using "query" for a path variable is invalid.📝 Syntax
advanced1:30remaining
Which option is the correct syntax for defining a POST request body in OpenAPI?
Select the correct JSON snippet that defines a POST request body with a JSON schema for a user object.
Attempts:
2 left
💡 Hint
Look for the correct key names and content type for JSON.
✗ Incorrect
The
requestBody field must include content with the media type application/json and a schema describing the data.🚀 Application
expert1:00remaining
How many parameters are defined in this endpoint documentation?
Count the total number of parameters defined for this endpoint, including path, query, and header parameters.
Rest API
{
"paths": {
"/search": {
"get": {
"parameters": [
{"name": "q", "in": "query", "required": true, "schema": {"type": "string"}},
{"name": "limit", "in": "query", "schema": {"type": "integer"}},
{"name": "Authorization", "in": "header", "required": true, "schema": {"type": "string"}}
],
"responses": {
"200": {"description": "Search results"}
}
}
}
}
}Attempts:
2 left
💡 Hint
Count all items inside the parameters array.
✗ Incorrect
There are three parameters: 'q' (query), 'limit' (query), and 'Authorization' (header).