Skip to main content

RAML 1.0 Multiple Types for a Single Request

Bonjour!

You must have come across a situation where you need to define two different Types for a particular resource in your RAML specification.

In this article, I'll show you how to do that!

you can define multiple Types using the pipe symbol ("|") as follows: 

The request Types can be defined in the header of the RAML. The examples  can be specified using facet "examples" and added in the form of either files using keyword "include" or the example itself.
 



Adios amigos!

Comments

Post a Comment

Popular posts from this blog

Mulesoft Interview Questions With Answers - Part 2

Bonjour! Let's take a look at some more Mulesoft basic interview-related questions! Which component is used for schema validation and routing incoming Mule messages against RAML? APIkit Router.  Mule provides  APIkit Router  for Schema validation and routing the incoming Mule messages, serializing responses,  validating payloads, Query parameters, URI parameters  against RAML .  Can you create a custom connector?  Yes.  When an  API specification  is published to  Anypoint Exchange,  it automatically generates a connector for it. What is the purpose of a domain project?  The main purpose of a domain project is to have all the  globally shared configurations  for the projects. All the shared resources can be configured in a domain project. Mule applications can be associated only with one domain project. However, a domain project can be associated with multiple mule applications. How do you override application properties?  You can configure your Mule application to automatically lo

Mulesoft Interview Questions With Answers - Part 1

Bonjour! What is Mulesoft? The first and the most basic question asked in Mulesoft developer interviews.  Mulesoft , is the vendor that provides an integration platform to help businesses connect data, applications, and devices. Mule , is the runtime engine of Anypoint Platform. It is a lightweight Java-based enterprise service bus (ESB) that allows developers to connect applications and exchange data. What is the difference between  map  and  mapObject? map   operator is used for  array.  It takes an  array  as input and returns an  array . mapObject  operator is used for  object  with key: value pairs. It takes an  object  as input and returns an  object . map  invokes lambda with two parameters:  value  and  index  from the input array.  Example: %dw 2.0 output application/json --- ["apple", "orange", "banana"] map (value, index) -> {      (index) : value } Output : [ { "0" : "apple" }, { "1" : "orange" }, {