For BE/B.Tech/BCA/MCA/ME/M.Tech Major/Minor Project for CS/IT branch at minimum price Text Message @ 9424820157

Documentation in RAML | Documentation in Mule 4

  Documentation in RAML | Documentation in Mule 4


For defining and declaring different contents in RAML, we need to document those things in RAML. For this we need to make a separate documentation.raml and include that documentation.raml in our main raml.



#%RAML 1.0 DocumentationItem
title: User details
content: The API performs CRUD operations about user details
This documentation.raml is included in our main raml by include tag.

Our main raml is employeeDetails.raml which is defined below.


#%RAML 1.0
title: dbcrud
version: v1
mediaType: 
  - application/json
protocols: [HTTP,HTTPS]
documentation:
  - title: User Details
    content: !include documentation/documentation.raml
types:
  insertReqSchema: !include schemas/insertReqSchema.json
  updateReqSchema: !include schemas/updateReqSchema.json
annotationTypes: 
  department: string
uses:
  files: Library/library.raml
securitySchemes:
  basicAuth: 
    description: It is used for authenticating uses by username & password
    type: Basic Authentication
    describedBy:
      headers:
        client_id: string
        client_secret: string  
    
/employee:
  get:   
   (department): IT
   is: [files.client-id-required,files.client-secret-required,files.errors]
   queryParameters:
     id:
      description: for fetching employee on the basis of id
      required: false
      minimum: 1
      maximum: 100
      type: integer
      example:
        2      
   responses:
     200:
       body:
         application/json:
           example: !include examples/searchRes               
  post:     
   is: [files.client-id-required,files.client-secret-required,files.errors]
   description: for posting employees data       
   body:
     application/json:
      example: !include examples/insertReq
      description: Request body for inserting the data
      type: !include schemas/insertReqSchema.json
   responses:
    201:
     body:
       application/json:
        example: !include /examples/insertRes
  put:
   securedBy:
      - basicAuth 
   is: [files.client-id-required,files.client-secret-required,files.errors]
   description: for updating employees data
   body:
      application/json:
        example: !include examples/updateReq
        description: Request body for updating the data
        type: !include schemas/updateReqSchema.json      
   responses:
     204:
      body:
        application/json:
          example: !include /examples/updateRes       

  delete:
    securedBy:
      - basicAuth
    is: [files.client-id-required,files.client-secret-required,files.errors]               
    description: for deleting employees data
    responses:
     202:
      body:
        application/json:
          example: !include /examples/deleteRes
           
  /{id} :
    get:
      is: [files.client-id-required,files.client-secret-required,      files.errors]  
      description: for getting data of specific employee
      displayName : /employee/id
      responses:
        200:
         body:
           application/json:
             example: !include examples/searchIdRes

    delete:
      is: [files.client-id-required,files.client-secret-required,      files.errors]  
      description: for deleting data of specific employee
      displayName : /employee/id
      responses:
        200:
         body:
           application/json:
             example: !include examples/deleteIdRes

No comments:

Post a Comment



Please go through below tutorials:


Mule 4 Tutorials

DEPLOY TO CLOUDHUB C4E CLIENT ID ENFORCEMENT CUSTOM POLICY RABBIT MQ INTEGRATION
XML TO JSON WEBSERVICE CONSUMER VM CONNECTOR VALIDATION UNTIL SUCCESSFUL
SUB FLOW SET & REMOVE VARIABLE TRANSACTION ID SCATTER GATHER ROUND ROBIN
CONSUME REST WEBSERVICE CRUD OPERATIONS PARSE TEMPLATE OBJECT TO JSON LOAD STATIC RESOURCE
JSON TO XML INVOKE IDEMPOTENT FILTER FOR EACH FLAT TO JSON
FIXWIDTH TO JSON FIRST SUCCESSFUL FILE OPERATIONS EXECUTE ERROR HANDLING
EMAIL FUNCTIONALITY DYNAMIC EVALUATE CUSTOM BUSINESS EVENT CSV TO JSON COPYBOOK TO JSON
CHOICE ASYNC

Widely used Connectors in Mule 3

CMIS JETTY VM CONNECTOR SALESFORCE POP3
JMS TCP/IP WEBSERVICE CONSUMER QUARTZ MONGO DB
FILE CONNECTOR DATABASE CONNECTOR


Widely used Scopes in Mule 3

SUB FLOW REQUEST REPLY PROCESSOR CHAIN FOR EACH CACHE
ASYNC TCP/IP COMPOSITE SOURCE POLL UNTIL SUCCESSFUL
TRANSACTIONAL FLOW

Widely used Components in Mule 3

EXPRESSION CXF SCRIPT RUBY PYTHON
JAVASCRIPT JAVA INVOKE CUSTOM BUSINESS EVENT GROOVY
ECHO LOGGER


Widely used Transformers in Mule 3

MONGO DB XSLT TRANSFORMER REFERENCE SCRIPT RUBY
PYTHON MESSAGE PROPERTIES JAVA TRANSFORMER GZIP COMPRESS/UNCOMPRESS GROOVY
EXPRESSION DOM TO XML STRING VALIDATION COMBINE COLLECTIONS BYTE ARRAY TO STRING
ATTACHMENT TRANSFORMER FILE TO STRING XML TO DOM APPEND STRING JAVASCRIPT
JSON TO JAVA COPYBOOK TO JSON MAP TO JSON JSON TO XML FLATFILE TO JSON
FIXWIDTH TO JSON CSV TO JSON


Widely used Filters in Mule 3

WILDCARD SCHEMA VALIDATION REGEX PAYLOAD OR
NOT MESSAGE PROPERTY MESSAGE IDEMPOTENT FILTER REFERNCE
EXPRESSION EXCEPTION CUSTOM AND


Exception Strategy in Mule 3

REFERENCE EXCEPTION STRATEGY CUSTOM EXCEPTION STRATEGY CHOICE EXCEPTION STRATEGY CATCH EXCEPTION STRATEGY GLOBAL EXCEPTION STRATEGY


Flow Control in Mule 3

CHOICE COLLECTION AGGREGATOR COLLECTION SPLITTER CUSTOM AGGREGATOR FIRST SUCCESSFUL
MESSAGE CHUNK AGGREGATOR MESSAGE CHUNK SPLITTER RESEQUENCER ROUND ROBIN SOAP ROUTER