About Generating RAML-based Flows
From a RAML specification, the APIkit scaffolding technique typically generates the following components in APIkit 4.x:
Basic configuration files plus a Mule XML configuration (Mule code)
An implementation of the API
HTTP listener and APIkit router
For routing and binding to RAML resources.
An API Console
For simulating calls to the API using the mocking service.
A mock implementation. Later you need to add the business logic to the flows.
In Studio, the APIkit project looks something like this:
A flow is generated for each resource method:
The generated, minimal flows meets the communication operations required by a REST contract.
The APIkit router is a key message processor that routes messages from the incoming API request to the corresponding Mule flows and serializes a response. It also enriches messages by adding default values to the messages. For example, APIkit returns a
Bad request response if the request is invalid, and a
Not implemented response if the API resource that you request is not associated with a flow.
Although the APIkit router can validate your request payload, headers, query, and URI parameters, the router does not validate everything declared in an API specification. For example, the router does not validate authentication because API Gateway policies, which execute before your request reaches the router, are responsible for enforcing authentication.