Learn the vocabulary of schema validation in API testing: JSON Schema, OpenAPI contract validation, breaking changes, and schema drift.
0 / 45 completed
1 / 45
A test failure message says 'the response doesn't match the schema'. What does this mean?
Schema validation failures mean the actual API response (field names, types, required fields, formats) doesn't conform to the contract defined in the schema, indicating a potential breaking change.
2 / 45
What is 'breaking change detection' in API contract testing?
Breaking change detection tools compare two versions of an API schema and flag changes that would break consumers: removed fields, changed types, new required fields, or renamed endpoints.
3 / 45
What does 'schema drift' mean in an API context?
Schema drift occurs when the live API implementation gradually diverges from its documented schema without intentional versioning — a common problem when documentation isn't updated alongside code changes.
4 / 45
What is 'OpenAPI contract validation' in an integration test?
OpenAPI contract validation means making real HTTP requests and comparing the responses (status codes, headers, body structure) against the API's OpenAPI spec to ensure implementation matches documentation.
5 / 45
In JSON Schema, what does the `required` keyword validate?
The `required` keyword in JSON Schema is an array of property names that must be present in the object. Validation fails if any listed property is missing from the actual response.
6 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
7 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
8 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
9 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
10 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
11 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
12 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
13 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
14 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
15 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
16 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
17 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
18 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
19 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
20 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
21 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
22 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
23 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
24 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
25 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
26 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
27 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
28 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
29 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
30 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
31 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
32 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
33 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
34 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
35 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
36 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
37 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
38 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
39 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
40 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
41 / 45
Sarah: "Hey team, I've just submitted a PR for the new user onboarding flow. The API gateway is returning a 400 error and the response body says 'Invalid request format'. I'm not sure what that means in relation to the schema."
Sarah's message indicates a common problem: the API gateway is rejecting the request because it doesn't conform to the expected schema. "Invalid request format" specifically points to issues with the data *structure* or content of the JSON payload—perhaps a missing field specified as `required` in the schema, or an incorrect data type where the schema mandates a string instead of a number. It's important to investigate whether the incoming data matches the defined structure before proceeding.
42 / 45
David: 'I've just submitted a pull request to update the User Profile API. The schema validator is failing with an error message saying 'Missing field: `phoneNumber`'. I'm getting this validation failure even though the documentation states that `phoneNumber` is *optional*. What could be causing this?',
The key here is understanding that 'Missing field' errors in schema validation often indicate a discrepancy between the client-side request and the *expectation* defined by the schema. While `phoneNumber` might indeed be optional according to the API documentation, the schema itself could still require it for completeness or future expansion. The correct answer reflects this common scenario - the client isn't sending the field, but the schema is expecting it, resulting in a validation failure. Options A and B suggest problems with server-side logic that aren't necessarily the root cause of the immediate issue.
43 / 45
During a code review, Liam says to Maria: 'The schema validation is failing on the new v2 API endpoint. It's throwing an error saying 'Property 'email' is not allowed'. I'm confused – isn't email always required for user accounts?' What's the most accurate explanation of why this might be happening in a situation where the schema has been updated?
Liam is misunderstanding schema validation's role: the validator isn't there to enforce business rules like requiring an email. Instead, it strictly enforces what the API *expects* in its requests according to the defined schema. The error message 'Property 'email' is not allowed' means the schema has been updated to explicitly state that 'email' is no longer a mandatory field; therefore, the validator flagged the request as invalid because it contained an unexpected property.
44 / 45
During a Slack discussion about a recent PR update to the `Customer Orders` API, Alex writes: 'The schema validator is reporting 'Invalid type for field 'orderDate': expected string but got integer'. This seems like a straightforward error, but I'm not sure if it indicates a fundamental problem with the data being sent or just a simple formatting issue. What's the *most* likely interpretation of this message in the context of schema validation?
This message indicates that the schema defines `orderDate` as a string and the client-side code is sending an integer. The core purpose of schema validation is to enforce data types—if the server expects a string but receives an integer, it's a clear violation. Simply stating 'invalid type' focuses on this fundamental mismatch between what was *expected* according to the contract and what was actually *received*. Options A and C are less precise; option D is a misinterpretation of schema validation – it's about data types, not security.
45 / 45
PR Description
Subject: Update User Profile API - v3
Body:
We've updated the User Profile API to include a new `subscriptionTier` field. The schema validator is failing with the message 'Missing property: `subscriptionTier`'. The documentation *doesn't* explicitly state that this field is required, but we want to ensure all requests are valid against the latest schema. What should be included in the PR description to clearly communicate this change and avoid future issues?
The correct answer is to explicitly state that `subscriptionTier` is now a required field. This provides clear guidance for consumers of the API who might not have immediately noticed the change in the documentation. The other options are incorrect because they either downplay the requirement, remove functionality, or fail to provide actionable information for developers – a key goal of a good PR description is to prevent future confusion and ensure smooth integration.
What will I practice in "Schema Validation Vocabulary Quiz"?
This is an API Contract Testing exercise set. It walks through 45 scenario-based multiple-choice questions built around real usage of API Contract Testing terminology that IT professionals encounter on the job.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to complete with no account, sign-up, or paywall.
How many questions are in this exercise?
This set contains 45 questions. Each one shows immediate feedback and a detailed explanation after you answer, so you learn the correct usage right away rather than waiting for a final score.
Do I need prior experience to complete this exercise?
No prior experience is required. Each question includes a full explanation covering the reasoning behind the correct answer, so the exercise itself teaches the API Contract Testing vocabulary as you go.
Can I retry the exercise if I get questions wrong?
Yes — use the "Try again" button on the results screen to reset your answers and go through all the questions again. There is no limit on attempts.
Is my progress saved?
Your answers and score for the current session are tracked in the browser as you go. No account or login is needed, and there is nothing to install.
What if I don't understand a term used in a question?
Read the explanation shown after you answer each question — it breaks down the correct term in plain English with a real-world example. You can also check the site Glossary for quick definitions.
How is this different from reading a blog article on the topic?
Exercises like this one are interactive drills that test and reinforce specific vocabulary through multiple-choice questions, while blog articles explain concepts in prose. Practising here after reading builds active recall, not just passive recognition.
Where can I find more API Contract Testing exercises?
See the API Contract Testing exercises hub for the full set of related pages, or browse all exercise categories from the main Exercises index.
Can I use this exercise to prepare for a technical interview?
Yes — API Contract Testing vocabulary comes up often in technical discussions and interviews. Pair this exercise with our dedicated Interview Preparation section for role-specific practice.