Advanced JSON Schema


The JSON body and JSON Schema for a request or response can be generated from the attributes section MSON data structure. The generated schema can also be overridden by providing an explicit schema, as you can see in the examples below.

API Blueprint

Notes

Get a note

Gets a single note by its unique identifier.

REQUEST

Parameters
id id abc123

Unique identifier for a note

RESPONSE

Headers
Content-Type application/json
200 application/json
                      {
  "id": "abc123",
  "title": "This is a note",
  "content": "This is the note content.",
  "tags": [
    "todo",
    "home"
  ]
}
                    
                      {
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "tags": {
      "type": "array"
    }
  }
}
                    

Update a note

Modify a note's data using its unique identifier. You can edit the title, content, and tags.

REQUEST

Parameters
id id abc123

Unique identifier for a note

Headers
Content-Type application/json
application/json
                        {
  "title": "This is another note",
  "content": "",
  "tags": [
    "todo",
    "work"
  ]
}
                      
                        {
  "type": "object",
  "description": "This is a custom schema!",
  "properties": {
    "title": {
      "type": "string"
    },
    "content": {
      "type": "string"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}
                      

RESPONSE