PUBLIC BETA OFFER

Save 50% off on an Eligible Learning PlanValid for 1-month plan, 3-month plan, 12-month plan · Code LPXBETA50 · Ends Nov 4, 2026

Learning Path

Software Engineering Foundations

Knowledge domainApplications and Integration
Learning topic1 of 6
Questions22 questions
Study time1 hr 27 min
AccessFree read-only learning
Question 1single_choice

REST APIs and JSON

An integration developer is fixing a request to the team's internal report service. Its published contract requires max_items to be a JSON number representing a positive whole number and preview to be a JSON boolean. It performs no string-to-number or string-to-boolean coercion. For this service, status 422 means the body parsed as JSON but failed the field-type contract; it does not indicate a transport failure.

The caller wants a limit of four items and preview mode disabled. The captured exchange is:

POST /v1/reports HTTP/1.1
Host: reports.example
Content-Type: application/json

{"max_items":"4","preview":"false"}

HTTP/1.1 422 Unprocessable Content
Content-Type: application/json

{"error":{"code":"field_type_mismatch","fields":["max_items","preview"]}}

The method, path, and headers already match the service contract. Which replacement body satisfies the field types and preserves the caller's requested values?

Choose one answer.