There is an error in the RAML under the flight_id resource GET method. What needs to be done to fix the problem?

Study for the MuleSoft Associate / Development Fundamental Test. Master key concepts with flashcards and multiple choice questions, complete with hints and explanations. Prepare thoroughly for your exam!

Multiple Choice

There is an error in the RAML under the flight_id resource GET method. What needs to be done to fix the problem?

Explanation:
RAML uses YAML indentation to define the hierarchy of resources and the HTTP methods that apply to each resource. The GET operation for a specific flight belongs inside the resource that represents that path, typically /flights/{flight_id}. If the GET block sits at the same indentation level as the {flight_id} resource, it isn’t actually inside that resource and the parser will flag an error or misinterpret the structure. Indenting the GET method one level deeper signals that it is a child operation of the /flights/{flight_id} resource, which fixes the structure and associates the method with the correct path. Adding or removing a slash wouldn’t fix this indentation-related syntax issue, and moving the GET to a new resource under /flights would change the path semantics. Removing the GET would not address the underlying formatting error.

RAML uses YAML indentation to define the hierarchy of resources and the HTTP methods that apply to each resource. The GET operation for a specific flight belongs inside the resource that represents that path, typically /flights/{flight_id}. If the GET block sits at the same indentation level as the {flight_id} resource, it isn’t actually inside that resource and the parser will flag an error or misinterpret the structure. Indenting the GET method one level deeper signals that it is a child operation of the /flights/{flight_id} resource, which fixes the structure and associates the method with the correct path.

Adding or removing a slash wouldn’t fix this indentation-related syntax issue, and moving the GET to a new resource under /flights would change the path semantics. Removing the GET would not address the underlying formatting error.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy