This document defines API Blueprint AST Source Map. API Blueprint Source Map is 1-on-1 with API Blueprint AST and represents the source maps for each of the nodes in the AST tree.
Refer to the API Blueprint AST Definition – the version of the Source Map always conforms to the version of API Blueprint AST.
Following is the definition of Source map media types using the MSON syntax.
Set of indices to source code blocks. The blocks may be non-continuous.
Each block is defined by a zero-based index of its first character and the number of following characters.
- (array, fixed) - A tuple defining position of a block in the source code
- 1219 (number) - Zero-based index of the first character
- 30 (number) - Number of the characters in the block
Source map of the Blueprint.
metadata
(array[Source Map]) - An array of source maps where each item in metadata has its own source mapname
(Source Map) - Source map of API namedescription
(Source Map) - Source map of API descriptionresourceGroups
(array[Resource Group Source Map]) - Deprecatedcontent
(array[Element Source Map]) - Source map of section elements
attributes
name
(Source Map) - Source map of the element name
content
(enum)- (array[Element Source Map]) - Source maps of nested elements (for element
category
) - (Source Map) - Source map (for element
copy
andasset
) - (Resource Source Map) - Source map of Resource (for element
resource
) - (Data Structure Source Map) - Source map of Data Structure (for element
dataStructure
)
- (array[Element Source Map]) - Source maps of nested elements (for element
Deprecated
Source map of the Resource Group.
name
(Source Map) - Source map of name of the Resource Groupdescription
(Source Map) - Source map of description of the Resource Groupresources
(array[Resource Source Map]) - Ordered array of the respective resources belonging to the Resource Group
Source map of the Resource.
name
(Source Map) - Source map of name of the Resourcedescription
(Source Map) - Source map of description of the ResourceuriTemplate
(Source Map) - Source map of URI Templatemodel
(Payload Source map) - Resource Model, a reusable payload representing the resourceparameters
(array[Parameter Source Map]) - Ordered array of source maps of URI parametersactions
(array[Action Source Map]) - Ordered array of source maps of actions available on the resource each defining at least one complete HTTP transactioncontent
(array[Data Structure Source Map]) - Ordered array of Resource source map's elements
Source map of the Action.
name
(Source Map) - Source map of name of the Actiondescription
(Source Map) - Source map of description of the Actionmethod
(Source Map) - Source map of HTTP request method defining the actionparameters
(array[Parameter Source Map]) - Ordered array of source maps of resource's URI parameters descriptions specific to this actionexamples
(array[Transaction Example Source Map]) - Ordered array of source maps of HTTP transaction examples for the relevant HTTP request methodattributes
(object)uriTemplate
(string) - Source map of URI Templaterelation
(string) - Source map of link relation identifier of the action
content
(array[Data Structure Source Map]) - Ordered array of Action source map's elements
Source map of Payload.
When a reference is used, the source map of the payload is in fact the source map of the Resource Model.
-
name
(Source Map) - Source map of name of the payload -
reference
(Source Map) - Source map of the reference, present if and only if a reference to a Resource Model is present in the payload and it has been resolved correctly -
description
(Source Map) - Source map of description of the payload -
attributes
([Attributes Source Map][]) - Source map of attributes of the Payload -
headers
(array[Source Map]) - Ordered array of source maps of HTTP headers that are expected to be transferred with HTTP message represented by this payload. Each item in the header has it's own source map. -
body
(Source Map) - DeprecatedSource map of body to be transferred with HTTP message represented by this payload
Note this property is deprecated and will be removed in a future. Use
assets/body/source
instead. -
schema
(Source Map) - DeprecatedSource map of a validation schema for the entity body as defined in
body
.Note this property is deprecated and will be removed in a future. Use
assets/schema/source
instead. -
content
(array) - Ordered array of Payload source map's elements- Items
Asset Source Map (Element Source Map)
Source map of Asset
Source map of Parameter.
description
(Source Map) - Source map of description of the parametertype
(Source Map) - Source map of an arbitrary type of the parameter (a string)required
(Source Map) - Source map of boolean flag denoting whether the parameter is required (true) or not (false)default
(Source Map) - Source map of a default value of the parameter (a value assumed when the parameter is not specified)example
(Source Map) - Source map of an example value of the parametervalues
(array[Source Map]) - Source map of an array enumerating possible parameter values. Each item has it's own source map.
Source map of Transaction Example.
name
(Source Map) - Source map of name of the Transaction Exampledescription
(Source Map) - Source map of description of the Transaction Examplerequests
(array[Payload Source Map]) - Ordered array of source maps of example transaction request payloadsresponses
(array[Payload Source Map]) - Ordered array of source maps of example transaction response payloads
Data Structure Source Map (Named Type Source Map)
Source map of Data Structure
The application/vnd.apiblueprint.sourcemap
is the base media type for API Blueprint AST Source Map.
Two supported, feature-equal serialization formats are JSON and YAML:
application/vnd.apiblueprint.sourcemap+json
application/vnd.apiblueprint.sourcemap+yaml