RAML Interview Questions
1) What is RAML?
RAML stands for Restful API Modelling Language. RAML can be used for:
1. API specification
2. We can mock API by RAML and API console.
3. We can generate an interface by RAML.
4. We can use RAML for API documentation.
5. It's a contract between APIs.
RAML lets you see what your API looks like as you design it, using easy-to-read plain text. RAML makes it easy to manage the API lifecycle from design to deployment to sharing. RAML is used for API modeling. RAML is both machine and human-readable.
2) What are overlays in RAML?
Overlays are used to extend non-behavioural aspects of an API, such as descriptions, usage directions, and user documentation items.
Example: RAML 1.0 Overlay
For example: in API documentation if documentation is needed in multiple languages then overlays can be used.
3) What are Extensions in RAML?
The extension is used to extend or override behavioural aspects of the API.
Example: RAML 1.0 Extension
As you may infer from the name, extensions are used to extend an API by adding new behaviours and/or modifying existing behaviours of an API. An analogy from the object-oriented programming world would be a subclass extending a superclass, where the subclass can add new methods and/or override existing methods. An extension may also extend an API's non-functional aspects. For example: to define additional resources that are exposed only to a select set of users, such as administrators or users having been assigned a particular role. An extension could also be used to add features for a newer version of an API.
4) What is an API kit?
API kit is required to convert RAML into Mule flows.
5) What are resource types in RAML?
A resource type, like a resource, can specify security schemes, methods, and other nodes. A resource that uses a resource type inherits its nodes. A resource type can also use, and thus inherit from, another resource type. Resource types and resources are related through an inheritance chain pattern. A resource type definition MUST NOT incorporate nested resources. A resource type definition cannot be used to generate nested resources when the definition is applied to a resource. A resource type definition does not apply to its own existing nested resources.
6) What are traits in RAML?
A trait, like a method, can provide method-level nodes such as description, headers, query string parameters, and responses. Methods that use one or more traits inherit nodes of those traits. A resource and resource type can also use, and thus inherit from, one or more traits, which then apply to all methods of the resource and resource type. Traits are related to methods through a mixing pattern.
7) How to include examples in RAML?
By using include tag
example: !include insertExample
8) What are libraries in RAML?
RAML libraries may be used to modularize any number and combination of data types,
security schemes, resource types, traits, and annotations. Unlike a regular include or
typed fragment, a library contained in an external file must declare the top-level element
names that are being defined. in main RAML uses and is tags are used to
include libraries.
No comments:
Post a Comment