Salesforce Certified MuleSoft Developer Practice Questions

Salesforce Certified MuleSoft Developer exam preparationAligned with the official Exam Guide (Spring '24 release; guide version 13)

Salesforce Certified MuleSoft Developer practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 120 minutes.

Salesforce Certified MuleSoft Developer free question 3 / 10 · Domain 2: Designing APIs

In API Designer, the RAML 1.0 type Customer declares the properties id and name and has no additionalProperties facet. Its example has id, name and an extra property, loyaltyTier. The type Supplier is the same, except that it sets additionalProperties: false, and its example also has an extra property. How does the editor treat the two examples?

  1. Only the Supplier example is flagged, as should NOT have additional properties
  2. Neither example is flagged, since an example may add properties to its type
  3. Both the Customer and the Supplier examples are flagged as having extra properties
  4. Only the Customer example is flagged, because it lacks an additionalProperties facet
Show the answer and explanation

Answer: A

Why this is correct
Whether an example may carry properties that the type does not declare is controlled by the additionalProperties facet. When a type sets it to false and its example includes one or more properties that were not in the type declaration, the editor displays should NOT have additional properties. That is the Supplier case. Customer has no facet at all, and the page states that additionalProperties is true by default. That is why removing the line is listed as a fix, next to changing the value to true. So the Customer example with loyaltyTier is valid and only the Supplier example is flagged. The default suits evolving APIs: a consumer can receive new fields without the type breaking, and a designer who wants a closed shape has to say so with false.

Why the other options are wrong
"Both the Customer and the Supplier examples are flagged as having extra properties" … Customer is not flagged. The page lists removing the additionalProperties line as one of the fixes, because additionalProperties is true by default, so a type without the facet accepts extra properties.
"Neither example is flagged, since an example may add properties to its type" … Supplier sets additionalProperties to false, and that is exactly the case the page describes: an example with properties that were not in the type declaration makes the editor display should NOT have additional properties.
"Only the Customer example is flagged, because it lacks an additionalProperties facet" … This turns the rule around. Leaving out the facet is the same as setting it to true, because true is the default. It is the type that sets the facet to false, Supplier, whose example is flagged.

Three ways to clear the message
For a type with additionalProperties: false, the page offers three fixes: delete the extra property from the example, add the property to the type declaration, or set the facet to true or remove it. Pick the one that matches the intent: a closed shape, a new field, or an open type.

Go to the Salesforce Certified MuleSoft Developer practice app (10 free questions; purchase unlocks all questions)

See the full practice set