Documentation Best Practices
Section | Best Practice | Examples |
RAML header | Include the following elements
|
#%RAML 1.0
title: Student API
description: The Student API is intended to provide basic operations to access the Students data
version: v1
mediaType: application/json
protocols:
– HTTPS
documentation:
– title: Student domain
content: |-
The Student domain contains the following sections:
– A
– B
– C
|
Resources / Methods | Each resource-method pair should include the following elements:
|
/students:
displayName: /students get: description: Get all students based on filters displayName: get |
Responses | Each response code should include the following elements:
|
responses:
‘200‘: description: List of student was returned successfully body: application/json: type: Student |
Headers / Query Parameters | Each header and query parameter should include the following elements:
|
headers:
callerId: description: Id to track the request type: string queryParameters: filter: description: Filter type: string order: description: Order type: string |
Data Types | Each Data Type should include the following elements:
Each property should include the following elements
|
Student:
required: false description: Student Data Type type: object properties: id: required: true description: Student ID type: integer name: required: true description: Name of the Student (e.g. John Doe) type: string |